better sudo catching

This commit is contained in:
K9BFF committed 2025-11-11 13:00:10 -06:00
1 parent 853fb23507
commit 0d54c3284a
1 file changed
+11
+11
View File
@@ -11,6 +11,16 @@ su_check() {
fi
}
# inverse sudo check because i found a bug last night
inv_su_check() {
if [[ $EUID -ne 0 ]]; then
echo
else
echo "sysop: don't run this flag as sudo!"
exit 1
fi
}
# rebuild
@@ -42,6 +52,7 @@ elif [[ $1 == "-d" ]]; then
# nix-shell
elif [[ $1 == "-p" ]]; then
inv_su_check
nix-shell -p "$2" |& nom