From a9f63b05c724bfec57c5132cbcb688bcca011986 Mon Sep 17 00:00:00 2001 From: Arinerron Date: Thu, 28 Mar 2019 11:08:36 -0700 Subject: [PATCH] Add error handing to Arch Linux installation script --- install/install_arch.sh | 6 ++++++ 1 file changed, 6 insertions(+) mode change 100644 => 100755 install/install_arch.sh diff --git a/install/install_arch.sh b/install/install_arch.sh old mode 100644 new mode 100755 index 5cc80d40..c23458c4 --- a/install/install_arch.sh +++ b/install/install_arch.sh @@ -7,8 +7,12 @@ LOG_DIR='/var/log/onionr' BRANCH='master' +# setup error handlers + set -e +trap "echo -e '\033[31mOnionr installation failed.\033[0m' >&2; exit 1337" ERR INT TERM + # require root permissions if ! [ $(id -u) = 0 ]; then @@ -74,4 +78,6 @@ systemctl start onionr # and we're good! +trap - ERR + exit 0