5
0
Fork 0

commit by to_remotes 2024-05-03 13:04:56 +0200 from vmdevhw

main
Holger Wasem 2024-05-03 13:04:56 +02:00
parent cdff1f674c
commit 9c63192b55
1 changed files with 6 additions and 4 deletions

View File

@ -10,8 +10,10 @@ function init_repos(){
else else
echo -n "client name: " echo -n "client name: "
read -r CLIENT_NAME read -r CLIENT_NAME
echo -n "deploy key suffix. Leave blank if first: "
read -r DEPLOY_KEY_SUFFIX
if [ ! -f $HOME/.ssh/deploy_key ]; then if [ ! -f $HOME/.ssh/deploy_key$DEPLOY_KEY_SUFFIX ]; then
echo "create ssh key" echo "create ssh key"
echo -n "ssh passphrase: " echo -n "ssh passphrase: "
@ -26,7 +28,7 @@ function init_repos(){
mkdir -p $HOME/.ssh mkdir -p $HOME/.ssh
ssh-keygen -t rsa -N "$passphrase" -C "deploy_key_$CLIENT_NAME" -f $HOME/.ssh/deploy_key ssh-keygen -t rsa -N "$passphrase" -C "deploy_key_$CLIENT_NAME" -f $HOME/.ssh/deploy_key$DEPLOY_KEY_SUFFIX
echo "please upload now pub key by logging into user $CLIENT_NAME keys ..." echo "please upload now pub key by logging into user $CLIENT_NAME keys ..."
echo "if user does not exit. login with admin user and create new user with name: $CLIENT_NAME" echo "if user does not exit. login with admin user and create new user with name: $CLIENT_NAME"
@ -36,7 +38,7 @@ function init_repos(){
echo "https://git.service.wiseadvice.eu/user/settings/keys" echo "https://git.service.wiseadvice.eu/user/settings/keys"
echo " " echo " "
cat $HOME/.ssh/deploy_key.pub cat $HOME/.ssh/deploy_key$DEPLOY_KEY_SUFFIX.pub
fi fi
echo " " echo " "
@ -56,7 +58,7 @@ function init_repos(){
cat <<EOT >> $HOME/.ssh/config cat <<EOT >> $HOME/.ssh/config
Host git.service.wiseadvice.eu Host git.service.wiseadvice.eu
HostName git.service.wiseadvice.eu HostName git.service.wiseadvice.eu
IdentityFile ~/.ssh/deploy_key IdentityFile ~/.ssh/deploy_key$DEPLOY_KEY_SUFFIX
Port 8422 Port 8422
IdentitiesOnly yes IdentitiesOnly yes
EOT EOT