From 50bdaa7098d8bf12e35f2412d7ec82e7a9251242 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 21 Jul 2023 20:58:50 +0200 Subject: [PATCH] username --- app.sh | 4 ++-- docker-compose.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app.sh b/app.sh index 87ed96c..0639cf9 100644 --- a/app.sh +++ b/app.sh @@ -55,7 +55,7 @@ while true ; do # Set the IFS to a comma to split the values IFS=',' - while read -r FQDN SSH_KEY_PATH; do + while read -r FQDN USERNAME SSH_KEY_PATH; do # bereinige FQDN FQDN=$(echo "$FQDN" | tr -d "[:space:]") # prüfe ob Key existiert @@ -65,7 +65,7 @@ while true ; do exit 2 fi echo "export $FQDN config" - ssh -n -o StrictHostKeyChecking=no -i "$SSH_KEY_PATH" "$FQDN" "/export show-sensitive" > "config_${FQDN}.rsc" + ssh -n -o StrictHostKeyChecking=no -i "$SSH_KEY_PATH" "${USERNAME}@${FQDN}" "/export show-sensitive" > "config_${FQDN}.rsc" 2> /dev/null # entferne Datumszeile sed -i -r '/^# [0-9]{4}-[0-9]{2}-[0-9]{2}\s[0-9]{2}\:[0-9]{2}\:[0-9]{2}\sby\sRouterOS\s[0-9\s\.]+/d' "config_${FQDN}.rsc" git add "config_${FQDN}.rsc" diff --git a/docker-compose.yml b/docker-compose.yml index 5b4f15f..fae0d45 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,8 +16,8 @@ services: environment: # Format , #siehe volunmes DEVICES: | - rb5009.grote.lan,/neu - hex.grote.lan,/ssh/keys/hex + rb5009.grote.lan,admin,/neu + hex.grote.lan,admin,/ssh/keys/hex GIT_REPO_BRANCH: "master" GIT_REPO_URL: "ssh://gitea@git.mgrote.net:2222/mg/testrepo.git" GIT_REPO_DEPLOY_KEY: "/neu" #siehe volunmes