From f06d6831e453da5bf56d65a0c949c1789753f136 Mon Sep 17 00:00:00 2001 From: pgrondek Date: Fri, 11 Sep 2020 08:18:57 +0200 Subject: [PATCH] Update script for network restarts --- prusa.yml | 6 ++++++ roles/router/files/monitor.sh | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 prusa.yml diff --git a/prusa.yml b/prusa.yml new file mode 100644 index 0000000..d04e61c --- /dev/null +++ b/prusa.yml @@ -0,0 +1,6 @@ +--- +- hosts: prusa.lan + roles: +# - ssh + - octoprint +# - ubuntu diff --git a/roles/router/files/monitor.sh b/roles/router/files/monitor.sh index 000b3da..c47285e 100755 --- a/roles/router/files/monitor.sh +++ b/roles/router/files/monitor.sh @@ -17,11 +17,12 @@ PING="/bin/ping -c 1 -W ${PING_TIMEOUT} -w ${PING_TIMEOUT}" RESET_MODEM_SCRIPT="/config/scripts/tplink_smartplug.py" DEBUG=true +DEBUG_FILE=/var/log/cron-monitor.log DISABLE_SOFT_RESTART=false function debug() { if [[ ${DEBUG} ]]; then - echo $@ + echo $@ > ${DEBUG_FILE} fi } @@ -32,7 +33,7 @@ function interfaceDown() { function interfaceUp() { interface=$1 - ip link set dev ${interface} down + ip link set dev ${interface} up } function soft_restart() {