install.sh: fail out on command failure

The current setup of install.sh means that all the other commands will still run if any command fails. This creates a volatile and unsafe state should something go wrong, one which may cause recovering difficulties depending on the type of failure.

This patch fixes that problem by adding the "set -e" command to the beginning of the script. This command will cause the script to exit if a command fails.

Signed-off-by: Amy Parker <apark0006@student.cerritos.edu>
This commit is contained in:
Amy 2023-07-19 20:35:56 -07:00 committed by GitHub
parent bd815bf26a
commit 0970c05b05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,8 @@
#!/bin/bash
# If any command fails, fail out
set -e
# Many things here need root access, so verify user is root
# If not, fail out and give an explanation
if [ $(id -u) -ne 0 ]; then