Skip to content

Commit

Permalink
Detect if PPID is empty and then ignore
Browse files Browse the repository at this point in the history
Fixes #25.
  • Loading branch information
wesbarnett committed Mar 8, 2019
1 parent 18a26d3 commit 905ed72
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/snap-pac
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ set -o errtrace
readonly argv0="snap-pac"
readonly SNAPPAC_CONFIG_FILE=/etc/snap-pac.conf
readonly SNAPPER_CONFIG_FILE=/etc/conf.d/snapper
readonly pacman_cmd="$(ps -q $(ps -p "$$" -o ppid=) -o args=)"
if [ -z $PPID ] || [ -z $(ps -q $PPID -o args=) ]; then
printf "Parent process ID is empty.\n"
readonly pacman_cmd=""
else
readonly pacman_cmd="$(ps -q $PPID -o args=)"
fi
readonly pre_or_post=$1

out() { printf "$1 $2\n" "${@:3}"; }
Expand Down

0 comments on commit 905ed72

Please sign in to comment.