aboutsummaryrefslogtreecommitdiffsponsor
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2024-04-27 13:05:43 -0500
committerSlack Coder <slackcoder@server.ky>2024-04-27 13:05:43 -0500
commite82682aef783dec0bc5383b146eae8e05185c6f1 (patch)
treee27c46e30b40e67e5793eb2cd9988830e7dd3129
parent7840c58155ba898a4f325edabe7fa55259394875 (diff)
downloadefi-sync-e82682aef783dec0bc5383b146eae8e05185c6f1.tar.xz
Correct root check
Fix a bug where the username was not being sourced correctly. The 'USER' environment variable is not set in sysVinit scripts.
-rw-r--r--efi-sync2
1 files changed, 1 insertions, 1 deletions
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