Skip to content

Commit

Permalink
Merge pull request #4 from reef-technologies/fix-nginx-letsencrypt-cron
Browse files Browse the repository at this point in the history
Update 50-letsencrypt-renew.sh
  • Loading branch information
mpnowacki-reef authored Dec 14, 2023
2 parents 5da166d + 07015a2 commit 328a206
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions entrypoint/50-letsencrypt-renew.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/sh
set -eu

[ -f "/usr/bin/certbot" ] || exit 0;
echo "Running certbot renew on startup..."
certbot --nginx renew

cron_dir=""

[ -d "/etc/periodic/daily/" ] && cron_dir="/etc/periodic/daily";
[ -d "/etc/cron.daily" ] && cron_dir="/etc/cron.daily";
[ ! "$cron_dir" = "" ] || exit 0;
[ ! "$cron_dir" = "" ] || exit 1;

certbot_file="${cron_dir}/certbot"
echo "Installing Let's Encrypt crontab script into $certbot_file"
echo "certbot -q --nginx renew" > "$certbot_file"
echo "#!/bin/sh" > "$certbot_file"
echo "certbot -q --nginx renew" >> "$certbot_file"
chmod +x "$certbot_file"

echo "Running certbot renew on startup..."
certbot --nginx renew

0 comments on commit 328a206

Please sign in to comment.