From cf1e0f7f5e7a4a8c21536986b32a478cacc31e4c Mon Sep 17 00:00:00 2001 From: Ben Charlton Date: Thu, 3 Jan 2019 21:46:46 +0000 Subject: [PATCH] fix ssh user --- sync-local.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sync-local.sh b/sync-local.sh index 356e87b..d7ffd98 100755 --- a/sync-local.sh +++ b/sync-local.sh @@ -9,19 +9,19 @@ for TARGET in ${TARGETS}; do for F in ${FILES}; do #echo ${F} EF="/etc/${F}" - scp -i ${ID} -q ${F} ${TARGET}:${EF}.new - ssh -i ${ID} ${TARGET} "test -f ${EF} && diff -u ${EF} ${EF}.new" + scp -i ${ID} -q ${F} root@${TARGET}:${EF}.new + ssh -i ${ID} root@${TARGET} "test -f ${EF} && diff -u ${EF} ${EF}.new" if [ $? != 0 ]; then - ssh -i ${ID} ${TARGET} "test -f ${EF} && mv ${EF} ${EF}.old; mv ${EF}.new ${EF}" + ssh -i ${ID} root@${TARGET} "test -f ${EF} && mv ${EF} ${EF}.old; mv ${EF}.new ${EF}" CHANGED=1 else - ssh -i ${ID} ${TARGET} "rm ${EF}.new" + ssh -i ${ID} root@${TARGET} "rm ${EF}.new" fi done if [ ${CHANGED} == 1 ]; then echo "Files changed, reloading ${TARGET}!"; - ssh -i ${ID} ${TARGET} "service pihole-FTL restart" + ssh -i ${ID} root@${TARGET} "service pihole-FTL restart" if [ $? != 0 ]; then echo "Got an error code restarting pihole-FTL on ${TARGET}, exiting!" exit 1