root check

This commit is contained in:
paukstelis
2022-09-28 20:51:03 -04:00
parent 5c665e0318
commit b8fd1dacde
2 changed files with 11 additions and 5 deletions

View File

@@ -2,7 +2,13 @@
#all operations must be with root/sudo
if (( $EUID != 0 )); then
echo "Please run as root (sudo)"
echo "Please run with sudo"
exit
fi
#this is a weak check, but while catch most cases
if [ "$USER" == root ]; then
echo "You should not run this script as root. Use sudo as a normal user"
exit
fi