From b686a8d91a8d61d75dc214d11b603809ffff6fb6 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 2 Mar 2025 16:57:26 +0100 Subject: [PATCH] Added missing function - old fish --- fish_cfg/functions/fish_is_root_user.fish | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 fish_cfg/functions/fish_is_root_user.fish diff --git a/fish_cfg/functions/fish_is_root_user.fish b/fish_cfg/functions/fish_is_root_user.fish new file mode 100644 index 0000000..2e32e1d --- /dev/null +++ b/fish_cfg/functions/fish_is_root_user.fish @@ -0,0 +1,12 @@ +# Defined in /usr/share/fish/functions/fish_is_root_user.fish @ line 4 +function fish_is_root_user --description 'Check if the user is root' + if test "$EUID" = 0 2>/dev/null + return 0 + end + + if contains -- $USER root toor Administrator + return 0 + end + + return 1 +end