From e82682aef783dec0bc5383b146eae8e05185c6f1 Mon Sep 17 00:00:00 2001 From: Slack Coder Date: Sat, 27 Apr 2024 13:05:43 -0500 Subject: Correct root check Fix a bug where the username was not being sourced correctly. The 'USER' environment variable is not set in sysVinit scripts. --- efi-sync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/efi-sync b/efi-sync index 02ab587..585b59f 100644 --- a/efi-sync +++ b/efi-sync @@ -43,7 +43,7 @@ require_efi () { } require_root () { - if [[ $USER != "root" ]]; then + if [[ "$(id --user --name)" != "root" ]]; then log "command must be run as root" exit 1 fi -- cgit v1.2.3