Add a check against running the script as root
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
#!/bin/bash
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
#Check if script has been run as root and exit if so, prompting the user to run as normal user
|
||||
if [ $(id -u) -eq 0 ]; then
|
||||
echo "Please do not run this script as root or with sudo, it will prompt for your password and elevate as necessary"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
#Check if ~/.config/ArchUpdater exists and create it if not
|
||||
if [ ! -d "$HOME/.config/ArchUpdater" ]; then
|
||||
mkdir -p $HOME/.config/ArchUpdater
|
||||
|
||||
Reference in New Issue
Block a user