init work on standalone autoconf

This commit is contained in:
bunkerity
2020-12-08 23:27:23 +01:00
parent 419fdfc86e
commit fd0a6412d0
5 changed files with 123 additions and 0 deletions

View File

@@ -27,6 +27,23 @@ function trap_exit() {
}
trap "trap_exit" TERM INT
# trap SIGHUP
function trap_reload() {
echo "[*] Catched reload operation"
if [ -f /tmp/nginx.pid ] ; then
echo "[*] Reloading nginx ..."
/usr/sbin/nginx -s reload
if [ $? -eq 0 ] ; then
echo "[*] Reload succesfull"
else
echo "[!] Reload failed"
fi
else
echo "[!] Ignored reload operation because nginx is not running"
fi
}
trap "trap_reload" HUP
# do the configuration magic if needed
if [ ! -f "/opt/installed" ] ; then
echo "[*] Configuring bunkerized-nginx ..."