mirror of
https://github.com/dragonlock2/matthewtran.com.git
synced 2026-06-28 01:58:34 +00:00
website and p2pool graceful stop
This commit is contained in:
@@ -18,4 +18,5 @@ COPY html /var/www/matthewtran.com/html
|
||||
# start script
|
||||
WORKDIR /root
|
||||
COPY sendgrid.ke[y] ip_update.py ./
|
||||
COPY cert_update.py ./
|
||||
COPY entry.sh ./
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
if __name__ == '__main__':
|
||||
while True:
|
||||
# try renew once a day
|
||||
subprocess.run(['certbot', 'renew', '--quiet'])
|
||||
time.sleep(86400)
|
||||
+7
-6
@@ -16,10 +16,11 @@ certbot --nginx \
|
||||
|
||||
nginx -s reload
|
||||
python3 ip_update.py &
|
||||
python3 cert_update.py &
|
||||
|
||||
# try renew once a day
|
||||
while true
|
||||
do
|
||||
certbot renew --quiet
|
||||
sleep 86400
|
||||
done
|
||||
cleanup() {
|
||||
echo "stopping..."
|
||||
}
|
||||
trap 'cleanup' TERM
|
||||
|
||||
wait $! # wait SIGTERM, other processes can just be killed
|
||||
|
||||
Reference in New Issue
Block a user