From 9722741bfd69d78604aa7daa775cbeb1f43cebe8ebdfe0e0b2b081b7eca3f072 Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Sat, 22 Aug 2026 06:21:31 +0200 Subject: [PATCH] check EUID instead of whoami for root --- install.sh | 2 +- pbc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 49feb26..9040e65 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/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" diff --git a/pbc b/pbc index f1ab402..2f0ede3 100755 --- a/pbc +++ b/pbc @@ -394,7 +394,7 @@ case "$action" in install) 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 $?