diff --git a/md-message b/md-message index 39b147c..262fabd 100755 --- a/md-message +++ b/md-message @@ -1,3 +1,4 @@ +#!/bin/bash MSG="$1" DOMAIN="$2" diff --git a/md-renewed b/md-renewed index b222589..e7bb549 100755 --- a/md-renewed +++ b/md-renewed @@ -81,13 +81,13 @@ function domain_renew { local DOMAIN="$1" for scr in /etc/md-renewed/$DOMAIN/*.cert; do - run_copy "$1" "/etc/md-renewed/$DOMAIN/$scr" + run_copy "$1" "$scr" done for scr in /etc/md-renewed/$DOMAIN/*.service; do - run_service "$1" "/etc/md-renewed/$DOMAIN/$scr" + run_service "$1" "$scr" done for scr in /etc/md-renewed/$DOMAIN/*.sh; do - /etc/md-renewed/$DOMAIN/$scr "$1" + $scr "$1" done } @@ -97,13 +97,18 @@ for f in /run/md-renewed/*; do if [[ ! -f $f ]]; then continue fi + HTTPD_RELOAD=y + DOMAIN=$(basename $f) + + rm -f $f if [[ ! -d /etc/md-renewed/$f ]]; then continue fi - domain_renew "$1" + domain_renew "$DOMAIN" + done if [[ $HTTPD_RELOAD == y ]]; then diff --git a/md-renewed.spec b/md-renewed.spec index 1d83f2c..3d385e7 100644 --- a/md-renewed.spec +++ b/md-renewed.spec @@ -1,5 +1,5 @@ Name: md-renewed -Version: 1.0.0 +Version: 1.0.1 Release: 1%{?dist} Summary: Restart service on Apache module mod_md certificate renewal License: MIT @@ -18,6 +18,7 @@ Source7: example.cert Source8: example.sh Requires: httpd +Requires: mod_md %{?systemd_requires} BuildRequires: systemd-rpm-macros @@ -28,8 +29,8 @@ Restart service on Apache module mod_md certificate renewal %{__rm} -rf %{buildroot} install -d -m 0755 %{buildroot}%{_libexecdir}/md-renewed -install -m 0644 %{SOURCE0} %{buildroot}%{_libexecdir}/md-renewed/ -install -m 0644 %{SOURCE1} %{buildroot}%{_libexecdir}/md-renewed/ +install -m 0755 %{SOURCE0} %{buildroot}%{_libexecdir}/md-renewed/md-renewed +install -m 0755 %{SOURCE1} %{buildroot}%{_libexecdir}/md-renewed/md-message install -d -m 0755 %{buildroot}%{_unitdir} install -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/ @@ -77,5 +78,5 @@ install -m 0755 %{SOURCE8} %{buildroot}%{_sysconfdir}/md-renewed/example.com/ %{_tmpfilesdir}/md-renewed.conf %changelog -* Thu Nov 30 2021 Zoran Pericic - 1.0.0-1 +* Tue Nov 30 2021 Zoran Pericic - 1.0.0-1 Initial release