Skip to content

Commit f540bee

Browse files
committed
feat: add alternative priv escalation
thias#123
1 parent c34f93a commit f540bee

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

nix/package/default.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ writeShellScriptBin "glim" ''
2626
exit 1
2727
fi
2828
29+
# Use alternative if sudo is not found
30+
if [[ ! `which sudo &>/dev/null` ]]; then
31+
if which doas &>/dev/null; then
32+
sudo () {
33+
doas "''$*"
34+
}
35+
else
36+
sudo () {
37+
su -c "''$*"
38+
}
39+
fi
40+
fi
41+
2942
# Find GLIM device (use the first if multiple found, you've asked for trouble!)
3043
USBDEV1=`blkid -L GLIM | head -n 1`
3144

0 commit comments

Comments
 (0)