catching sigterm for foundry

This commit is contained in:
Snogard 2024-06-09 18:29:40 +02:00
parent d3ce154d25
commit 25bbaf8c35

View File

@ -1,5 +1,14 @@
#!/bin/sh
_sig_term() {
echo "Chaught SIGTERM signal!"
kill -TERM "$node_pid" 2>/dev/null
}
trap _sig_term TERM
optionsPath=/home/foundry/data/Config/options.json
if [ -f "${optionsPath}" ]; then
@ -13,6 +22,9 @@ echo "${optionsPath} not found the settings will be applied on next restart"
fi
node "$@"
node "$@" &
node_pid=$!
wait $node_pid
exit 0