From 2ff31201f7d30bede90594ff36c18d821ca95c31 Mon Sep 17 00:00:00 2001 From: iguanajuice <125163000+iguanajuice@users.noreply.github.com> Date: Sun, 7 Apr 2024 00:20:47 -0400 Subject: [PATCH] Implement sudo alternatives --- glim.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/glim.sh b/glim.sh index 65f5e5c..88ecc82 100755 --- a/glim.sh +++ b/glim.sh @@ -9,6 +9,17 @@ if [[ `id -u` -eq 0 ]]; then exit 1 fi +# Use alternative if sudo is not found +if [[ ! `which sudo &>/dev/null` ]]; then + if which doas &>/dev/null; then + alias sudo=doas + else + sudo () { + su -c "$*" + } + fi +fi + # Sanity check : GRUB2 if which grub2-install &>/dev/null; then GRUB2_INSTALL="grub2-install"