website and p2pool graceful stop

This commit is contained in:
Matthew Tran
2024-09-17 02:02:35 +00:00
parent c888f10a52
commit c3ef9eb514
6 changed files with 32 additions and 8 deletions
+1
View File
@@ -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 ./
+10
View File
@@ -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
View File
@@ -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