From 33283f81ca26c7c95f9b90ba3bdab33e8af324d7 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Fri, 29 Nov 2024 00:28:39 +0100 Subject: [PATCH] Quit primary watchdog. --- deployment/primary-watchdog.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/deployment/primary-watchdog.sh b/deployment/primary-watchdog.sh index bfb6ce2..9fb8589 100755 --- a/deployment/primary-watchdog.sh +++ b/deployment/primary-watchdog.sh @@ -7,10 +7,12 @@ REMOTE="gandi" REMOTE_DIR="/var/powerdns/" DIR="$REMOTE_DIR" +VERBOSITY="0" + echo "directory: $DIR" local_update() { - echo "local update of domain $1" + [ "$VERBOSITY" = "1" ] && echo "local update of domain $1" pdns_control bind-reload-now $1 | grep "no such domain" # In case the update cannot be done, it might be because the zone wasn't loaded at all. @@ -20,17 +22,17 @@ local_update() { } local_delete() { - echo "TODO: local delete of domain $1" + [ "$VERBOSITY" = "1" ] && echo "TODO: local delete of domain $1" } remote_update() { - echo "remote update on $REMOTE $REMOTE_DIR/$1" - scp $DIR/$1 $REMOTE:$REMOTE_DIR + [ "$VERBOSITY" = "1" ] && echo "remote update on $REMOTE $REMOTE_DIR/$1" + scp -q $DIR/$1 $REMOTE:$REMOTE_DIR } remote_delete() { - echo "remote delete on $REMOTE $REMOTE_DIR/$1" - ssh $REMOTE rm $REMOTE_DIR/$1 + [ "$VERBOSITY" = "1" ] && echo "remote delete on $REMOTE $REMOTE_DIR/$1" + ssh -q $REMOTE rm $REMOTE_DIR/$1 } action() {