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

Commit

Permalink
ensure directory for sudo user
Browse files Browse the repository at this point in the history
  • Loading branch information
Heavybullets8 committed Oct 27, 2023
1 parent 2c08ae1 commit 385199d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/heavyscript
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ err_exit() {

if [[ -d "/root/heavy_script" ]]; then
script_dir="/root/heavy_script"
elif [[ $EUID -eq 0 && -n ${SUDO_USER:-} ]]; then
elif [[ $EUID -eq 0 && -n ${SUDO_USER:-} && -d "/home/$SUDO_USER/heavy_script" ]]; 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 385199d

Please sign in to comment.