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
|
## Error checking
|
||||||
#
|
#
|
||||||
# Quit if not root
|
# Quit if not root, only run if required
|
||||||
[[ ! $EUID -eq 0 ]] &&
|
if [[ ! $1 =~ ^(get-available|healthcheck) ]]; then
|
||||||
printf '\e[1;31m<#>\e[0m\e[1m This program has to be run as root\n\e[0m' &&
|
if [[ ! $EUID -eq 0 ]]; then
|
||||||
exit 1
|
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
|
# Check if all dependencies are installed, quit if not
|
||||||
for prog in btrfs wget dracut bootctl curl gpg gpgv; do
|
for prog in btrfs wget dracut bootctl curl gpg gpgv; do
|
||||||
|
|
Loading…
Add table
Reference in a new issue