Skip to content

Commit 294b97f

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

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

nix/package/default.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ 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+
alias sudo=doas
33+
else
34+
sudo () {
35+
su -c "$*"
36+
}
37+
fi
38+
fi
39+
2940
# Find GLIM device (use the first if multiple found, you've asked for trouble!)
3041
USBDEV1=`blkid -L GLIM | head -n 1`
3142

0 commit comments

Comments
 (0)