Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Add check for /root
Browse files Browse the repository at this point in the history
  • Loading branch information
Heavybullets8 committed Oct 27, 2023
1 parent 058c2cd commit 2c08ae1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/heavyscript
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ err_exit() {
exit "${2:-1}"
}

if [[ $EUID -eq 0 && -n ${SUDO_USER:-} ]]; then
if [[ -d "/root/heavy_script" ]]; then
script_dir="/root/heavy_script"
elif [[ $EUID -eq 0 && -n ${SUDO_USER:-} ]]; then
script_dir="/home/$SUDO_USER/heavy_script"
elif [[ -d "$HOME/heavy_script" ]]; then
script_dir="$HOME/heavy_script"
Expand Down

0 comments on commit 2c08ae1

Please sign in to comment.