diff --git a/ArchUpdater.sh b/ArchUpdater.sh index 37523fe..ea4fae3 100755 --- a/ArchUpdater.sh +++ b/ArchUpdater.sh @@ -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