export config without linebreaks
All checks were successful
lint, build and push / lint (push) Successful in 1s
lint, build and push / build (push) Successful in 12s

This commit is contained in:
Michael Grote 2025-01-01 22:37:36 +01:00
parent c041ea1bf8
commit 511c7165c7

2
app.sh
View file

@ -69,7 +69,7 @@ while true ; do
# check if target is reachable # check if target is reachable
if ssh -n -q -i "$SSH_KEY_PATH" -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=5 "${USERNAME}@${FQDN}" ; then if ssh -n -q -i "$SSH_KEY_PATH" -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=5 "${USERNAME}@${FQDN}" ; then
echo "[INFO] export $FQDN config..." echo "[INFO] export $FQDN config..."
ssh -n -o StrictHostKeyChecking=no -i "$SSH_KEY_PATH" "${USERNAME}@${FQDN}" "/export show-sensitive" > "config_${FQDN}.rsc" 2> /dev/null ssh -n -o StrictHostKeyChecking=no -i "$SSH_KEY_PATH" "${USERNAME}@${FQDN}" "/export show-sensitive terse" > "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"