From fd880b4a9d4f10b1e02d0f623d31eae2b13f9fce Mon Sep 17 00:00:00 2001 From: unknowndev233 Date: Thu, 26 Mar 2020 22:43:35 +0800 Subject: [PATCH] add files --- README.md | 11 ++++++++++- acme.sh.service | 12 ++++++++++++ acme.sh.timer | 9 +++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 acme.sh.service create mode 100644 acme.sh.timer diff --git a/README.md b/README.md index 3101073..188aa64 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ # acme.sh-systemd -systemd service for automatic Let's Encrypt(for acme.sh)renewals +systemd service for automatic Let's Encrypt(for acme.sh) renewals +The timer unit should be enabled. + +How to use + +mkdir -pm 0700 "/{etc,var/log}/acme.sh" + +add LOG_FILE='/var/log/acme.sh/acme.sh.log' + +acme.sh --home /etc/acme.sh command ...[parameters].... diff --git a/acme.sh.service b/acme.sh.service new file mode 100644 index 0000000..476b9fb --- /dev/null +++ b/acme.sh.service @@ -0,0 +1,12 @@ +[Unit] +Description=Renew Let's Encrypt Certificates +After=network.target network-online.target nss-lookup.target +Wants=network-online.target nss-lookup.target + +[Service] +# If the version of systemd is 240 or above, then uncommenting Type=simple and commenting out Type=exec +#Type=exec +Type=simple +User=root +ExecStart=/usr/bin/acme.sh --cron --home /etc/acme.sh +Restart=on-failure diff --git a/acme.sh.timer b/acme.sh.timer new file mode 100644 index 0000000..f399992 --- /dev/null +++ b/acme.sh.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Bimonthly check for acme.sh(Let's Encrypt) renewals + +[Timer] +OnCalendar=*-1/2-01 00:00:00 +Persistent=yes + +[Install] +WantedBy=timers.target