Exit inside parentheses doesn't exit script
Several error conditions were resulting in a message printed and "exit" being called, however expressions inside parentheses are executed in a subshell; consequently the *subshell* would exit but the parent shell continued running the script. https://stackoverflow.com/questions/19886797/exit-inside-parentheses-doesnt-exit-script
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#DO NOT RUN THIS YOURSELF because Step 1 is it reformatting /dev/sda WITHOUT confirmation,
|
||||
#which means RIP in peace qq your data unless you've already backed up all of your drive.
|
||||
|
||||
pacman -S --noconfirm dialog || (echo "Error at script start: Are you sure you're running this as the root user? Are you sure you have an internet connection?" && exit)
|
||||
pacman -S --noconfirm dialog || { echo "Error at script start: Are you sure you're running this as the root user? Are you sure you have an internet connection?"; exit; }
|
||||
RED='\033[0;31m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
Reference in New Issue
Block a user