initial commit
This commit is contained in:
13
need-root.sh
Normal file
13
need-root.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [ $(id -u) = 0 ]; then
|
||||
echo "The script needs to be run as root." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $SUDO_USER ]; then
|
||||
real_user=$SUDO_USER
|
||||
else
|
||||
real_user=$(whoami)
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user