This commit is contained in:
25
server-example.sh.in
Normal file
25
server-example.sh.in
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/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
|
Reference in New Issue
Block a user