From d4c91e5cf6e1707fcffbad04a4c926e88cba2d04 Mon Sep 17 00:00:00 2001 From: David Runge Date: Mon, 11 Jan 2016 17:33:14 +0100 Subject: bin/switch_wfs_os: Providing set +e/ set -e lines to make sure, that systemctl doesn't mess up this script, when it returns -1 on reboot. Make the script exit with 0. --- bin/switch_wfs_os | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/switch_wfs_os b/bin/switch_wfs_os index a05c0e7..7f2255d 100755 --- a/bin/switch_wfs_os +++ b/bin/switch_wfs_os @@ -52,8 +52,10 @@ if [ "$os_set" == "${os_new}" ] && [ "$os_current" == "${os_new}" ]; then sed -i 's/^DEFAULT .*/DEFAULT '${os_old}'/' $syslinux_location echo "Calling script on nodes:" if [[ "${hostnames_arch[0]}" == "$host" ]]; then + set +e ssh wfs@${hostnames_arch[1]} "/usr/bin/sudo bin/$(basename $0)" ssh wfs@${hostnames_arch[2]} "/usr/bin/sudo bin/$(basename $0)" + set -e fi else echo "Error: Script is not supposed to be running on this host!" @@ -86,4 +88,4 @@ fi echo "Rebooting." eval $reboot_cmd - +exit 0 -- cgit v1.2.3-70-g09d2