diff --git a/bin/heavyscript b/bin/heavyscript index 09174f95..9531a282 100644 --- a/bin/heavyscript +++ b/bin/heavyscript @@ -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"