diff options
author | David Runge <dave@sleepmap.de> | 2016-01-11 17:33:14 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2016-01-11 17:33:14 +0100 |
commit | d4c91e5cf6e1707fcffbad04a4c926e88cba2d04 (patch) | |
tree | 93ef2a51120aecd090e3a12aa5616e8725f3f06c | |
parent | 8032aa6b0432eeedad52e0d6920778d41bafa41d (diff) | |
download | dotfiles-d4c91e5cf6e1707fcffbad04a4c926e88cba2d04.tar.gz dotfiles-d4c91e5cf6e1707fcffbad04a4c926e88cba2d04.tar.bz2 dotfiles-d4c91e5cf6e1707fcffbad04a4c926e88cba2d04.tar.xz dotfiles-d4c91e5cf6e1707fcffbad04a4c926e88cba2d04.zip |
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.
-rwxr-xr-x | bin/switch_wfs_os | 4 |
1 files changed, 3 insertions, 1 deletions
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 |