Files
test-server/server-example.sh.in
parovoz 07d638e704
All checks were successful
CMake on a single platform / build (push) Successful in 11s
init
2025-10-11 21:37:42 +04:00

26 lines
531 B
Bash

#!/bin/bash
pid=''
run=true
start() {
@CMAKE_INSTALL_FULL_BINDIR@/@PROJECT_NAME@ \
--docroot='/var/empty;/favicon.ico,/resources,/style,/node_modules' \
--http-address 0.0.0.0 --http-port 8087 \
--config /etc/wt/wt_config.xml \
--resources-dir /usr/share/Wt/resources &> >(logger --tag @PROJECT_NAME@) & pid="$!"
}
shutdown() {
run=false
(( $pid )) && kill "$pid"
}
trap shutdown EXIT
start
while $run
do
wait "$pid" || { logger --tag @PROJECT_NAME@ -p 3 "restarting server after error"; start; }
done