Do not demand root if not required
This commit is contained in:
parent
1e1a3d2a6d
commit
277e0b54f4
1 changed files with 7 additions and 4 deletions
11
arkdep
11
arkdep
|
@ -152,10 +152,13 @@ healthcheck () {
|
|||
|
||||
## Error checking
|
||||
#
|
||||
# Quit if not root
|
||||
[[ ! $EUID -eq 0 ]] &&
|
||||
printf '\e[1;31m<#>\e[0m\e[1m This program has to be run as root\n\e[0m' &&
|
||||
exit 1
|
||||
# Quit if not root, only run if required
|
||||
if [[ ! $1 =~ ^(get-available|healthcheck) ]]; then
|
||||
if [[ ! $EUID -eq 0 ]]; then
|
||||
printf '\e[1;31m<#>\e[0m\e[1m This program has to be run as root\n\e[0m' &&
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if all dependencies are installed, quit if not
|
||||
for prog in btrfs wget dracut bootctl curl gpg gpgv; do
|
||||
|
|
Loading…
Add table
Reference in a new issue