Files
test-server/server-example.sh.in
parovoz bd66a42b95
All checks were successful
CMake on a single platform / build (push) Successful in 13s
init
2025-10-10 22:01:22 +04:00

26 lines
529 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