Create a function for killing the installer
This commit is contained in:
parent
a273143d5c
commit
2721d67eb9
|
@ -102,7 +102,7 @@ RUN \
|
|||
sleep 1; \
|
||||
done; \
|
||||
# Kill installer after timeout indicated by `maxCount`
|
||||
[ "$x" -eq "$maxCount" ] && { pkill -9 "$installerName"; mv "$logFile" "$logDir/timeout-try$try.log"; }; \
|
||||
[ "$x" -eq "$maxCount" ] && { kill_installer; mv "$logFile" "$logDir/timeout-try$try.log"; }; \
|
||||
} & \
|
||||
}; \
|
||||
wait "$pid"; \
|
||||
|
@ -144,12 +144,15 @@ RUN \
|
|||
-e ":end q;"; \
|
||||
exitCode="$?"; \
|
||||
# Kill installer if it got stuck (according to console output)
|
||||
[ "$exitCode" -eq 42 ] && pkill -9 "$installerName"; \
|
||||
[ "$exitCode" -eq 42 ] && kill_installer; \
|
||||
# Use `sed`s exit code if non-zero
|
||||
[ "$exitCode" -ne 0 ] && exit "$exitCode" || \
|
||||
# Return true otherwise
|
||||
true; \
|
||||
}; \
|
||||
kill_installer() { \
|
||||
pkill -9 "$installerName" > /dev/null 2>&1; \
|
||||
}; \
|
||||
display=:90; \
|
||||
export DISPLAY="$display"; \
|
||||
mkdir -p --mode=777 /tmp/.X11-unix; \
|
||||
|
|
Loading…
Reference in a new issue