From bb551c7159a4e06982d94973c96ca64057e70884 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Wed, 4 Jun 2025 19:43:45 +0100 Subject: renew.sh: allow renewing a single certificate --- renew.sh.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'renew.sh.in') diff --git a/renew.sh.in b/renew.sh.in index 689f992..cecf52a 100644 --- a/renew.sh.in +++ b/renew.sh.in @@ -240,11 +240,17 @@ _docert() { return $? } +_whichcert="$1"; shift +if ! [ -z "$1" ]; then + _fatal "unexpected argument: $1" +fi + cat "$_DOMAINS" \ | egrep -v '^(#|[[:space:]]*$)' \ | ( _default_args="" _exit=0 + _didany=0 while read identifier args; do if [ "$identifier" = "*" ]; then @@ -252,11 +258,20 @@ cat "$_DOMAINS" \ continue fi + if ! [ -z "$_whichcert" ] && [ "$_whichcert" != "$identifier" ]; then + continue + fi + if ! _docert "$identifier" $_default_args $args; then _exit=1 fi + _didany=1 done + if [ "$_didany" -eq 0 ] && ! [ -z "$_whichcert" ]; then + _fatal "certificate not found: %s" "$_whichcert" + fi + exit $_exit ) -- cgit v1.3