username
This commit is contained in:
parent
d7b94d73b9
commit
50bdaa7098
2 changed files with 4 additions and 4 deletions
4
app.sh
4
app.sh
|
@ -55,7 +55,7 @@ while true ; do
|
||||||
# Set the IFS to a comma to split the values
|
# Set the IFS to a comma to split the values
|
||||||
IFS=','
|
IFS=','
|
||||||
|
|
||||||
while read -r FQDN SSH_KEY_PATH; do
|
while read -r FQDN USERNAME SSH_KEY_PATH; do
|
||||||
# bereinige FQDN
|
# bereinige FQDN
|
||||||
FQDN=$(echo "$FQDN" | tr -d "[:space:]")
|
FQDN=$(echo "$FQDN" | tr -d "[:space:]")
|
||||||
# prüfe ob Key existiert
|
# prüfe ob Key existiert
|
||||||
|
@ -65,7 +65,7 @@ while true ; do
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
echo "export $FQDN config"
|
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
|
# 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"
|
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"
|
git add "config_${FQDN}.rsc"
|
||||||
|
|
|
@ -16,8 +16,8 @@ services:
|
||||||
environment:
|
environment:
|
||||||
# Format <FQDN>,<SSH_KEY_PATH to ssh-private-key(passwordless)> #siehe volunmes
|
# Format <FQDN>,<SSH_KEY_PATH to ssh-private-key(passwordless)> #siehe volunmes
|
||||||
DEVICES: |
|
DEVICES: |
|
||||||
rb5009.grote.lan,/neu
|
rb5009.grote.lan,admin,/neu
|
||||||
hex.grote.lan,/ssh/keys/hex
|
hex.grote.lan,admin,/ssh/keys/hex
|
||||||
GIT_REPO_BRANCH: "master"
|
GIT_REPO_BRANCH: "master"
|
||||||
GIT_REPO_URL: "ssh://gitea@git.mgrote.net:2222/mg/testrepo.git"
|
GIT_REPO_URL: "ssh://gitea@git.mgrote.net:2222/mg/testrepo.git"
|
||||||
GIT_REPO_DEPLOY_KEY: "/neu" #siehe volunmes
|
GIT_REPO_DEPLOY_KEY: "/neu" #siehe volunmes
|
||||||
|
|
Loading…
Reference in a new issue