check EUID instead of whoami for root

This commit is contained in:
2026-08-22 06:21:31 +02:00
parent 22abaf6431
commit 9722741bfd
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[ "$(whoami)" != "root" ] && echo "Error: installation only works as root!" >&2 && exit 1 (( EUID != 0 )) && echo "Error: installation only works as root!" >&2 && exit 1
API_ENDPOINT="https://git.ccc-rheintal.ch/api/v1/repos/spacefreak/pbc" API_ENDPOINT="https://git.ccc-rheintal.ch/api/v1/repos/spacefreak/pbc"
+1 -1
View File
@@ -394,7 +394,7 @@ case "$action" in
install) install)
update=${args[0]:-false} update=${args[0]:-false}
[ "$(whoami)" != "root" ] && echo "Error: installation only works as root!" >&2 && exit 1 (( EUID != 0 )) && echo "Error: installation only works as root!" >&2 && exit 1
install_proxmox_backup_client "$update" || exit $? install_proxmox_backup_client "$update" || exit $?