Commit 341df23f authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Łukasz Nowak

caddy-frontend: Cleanup PIDFILE after reload

parent f27a120e
...@@ -102,7 +102,7 @@ md5sum = ac17212a53be2c08ab84682ec665148d ...@@ -102,7 +102,7 @@ md5sum = ac17212a53be2c08ab84682ec665148d
[template-caddy-lazy-script-call] [template-caddy-lazy-script-call]
filename = templates/apache-lazy-script-call.sh.in filename = templates/apache-lazy-script-call.sh.in
md5sum = ebe5d3d19923eb812a40019cb11276d8 md5sum = b9f73f6323f9fceea054c46c854d2862
[template-graceful-script] [template-graceful-script]
filename = templates/graceful-script.sh.in filename = templates/graceful-script.sh.in
......
...@@ -9,6 +9,7 @@ if [ ! -f $PIDFILE ]; then ...@@ -9,6 +9,7 @@ if [ ! -f $PIDFILE ]; then
echo $PID > $PIDFILE echo $PID > $PIDFILE
sleep {{ wait_time }} sleep {{ wait_time }}
{{ lazy_command }} {{ lazy_command }}
rm -f $PIDFILE
else else
ps --pid `cat $PIDFILE` &>/dev/null ps --pid `cat $PIDFILE` &>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
...@@ -17,6 +18,7 @@ else ...@@ -17,6 +18,7 @@ else
echo $PID > $PIDFILE echo $PID > $PIDFILE
sleep {{ wait_time }} sleep {{ wait_time }}
{{ lazy_command }} {{ lazy_command }}
rm -f $PIDFILE
fi fi
fi fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment