fix sudo/root issue
This commit is contained in:
1 parent
a9d8aaa5de
commit
125f8df353
1 file changed
+7
-1
+7
-1
@@ -7,7 +7,13 @@ if (( $EUID != 0 )); then
|
||||
fi
|
||||
|
||||
#this is a weak check, but will catch most cases
|
||||
if [ $SUDO_USER ]; then user=$SUDO_USER; fi
|
||||
if [ $SUDO_USER ]; then
|
||||
user=$SUDO_USER
|
||||
else
|
||||
echo "You should not run this script as root. Use sudo as a normal user"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$user" == root ]; then
|
||||
echo "You should not run this script as root. Use sudo as a normal user"
|
||||
exit
|
||||
|
||||
Reference in new issue
Block a user