Fix FS_DIEONWM not finding a binary that doesn't exist

This commit is contained in:
Salt 2019-06-21 22:43:59 -05:00
parent a0e1243035
commit b0b4b673eb

View File

@ -460,20 +460,20 @@ step_postexecute() {
} }
step_wait() { step_wait() {
[ -n "$_dryrun" ] && exit 0 [ -n "$_dryrun" ] && exit 0
log "Send any termination signal to firestarter to log out"
trap step_logout EXIT trap step_logout EXIT
if [ -n "$FS_DIEONWM" ] && gettarget "$_configdir/wm" && has readlink; then if [ -n "$FS_DIEONWM" ] && gettarget "$_configdir/wm" && has readlink && has "$_return"; then
target="$_return" target="$(command -v "$_return")"
for job in $(jobs -p); do for job in $(jobs -p); do
if [ "$target" = "$(readlink /proc/$job/exe)" ]; then if [ "$target" = "$(readlink /proc/$job/exe)" ]; then
log "Waiting for WM to exit" log "Waiting for WM to exit: \"$_return\""
wait "$job" wait "$job"
exit 0
fi fi
done done
else log "Could not find WM: \"$target\""
log "Waiting for programs to exit"
wait
fi fi
log "Waiting for programs to exit"
wait
exit 0 exit 0
} }
step_logout() { step_logout() {