Improvements to setup scripts

This commit is contained in:
2024-06-20 00:09:44 +02:00
parent 455e154792
commit 35b6616e74
3 changed files with 4 additions and 8 deletions
+3 -5
View File
@@ -1,16 +1,14 @@
#!/bin/bash
CRON_FILE=/etc/cron.d/renew_ssl_certificates
CRON_FILE=/etc/cron.daily/renew-ssl-certs
if [ -f "$CRON_FILE" ]; then
echo "$CRON_FILE already exists, aborting."
exit 1
fi
echo "SHELL=/bin/sh" >> $CRON_FILE
echo "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> $CRON_FILE
echo "" >> $CRON_FILE
echo "0 2 * * * $(pwd)/renew-certificates.sh" >> $CRON_FILE
echo "#!/bin/bash" >> $CRON_FILE
echo "$(pwd)/renew-certificates.sh" >> $CRON_FILE
systemctl restart cron