]> git.zue.dev - git.zue.dev/commitdiff
does caddy need to be restarted?
authorAlex Pooley (@zuedev) <zuedev@gmail.com>
Mon, 23 Mar 2026 11:13:42 +0000 (11:13 +0000)
committerAlex Pooley (@zuedev) <zuedev@gmail.com>
Mon, 23 Mar 2026 11:13:42 +0000 (11:13 +0000)
cron/minutely.bash

index 06e4865388a9672bc3c15ae37849696aa6569c70..7abf20529062a37aedb6b8e4cab5f81c5934c4a2 100644 (file)
@@ -19,6 +19,7 @@ cd "$GIT_ZUE_DEV" || { echo "Failed to change directory to $GIT_ZUE_DEV. PANIC!"
 if ! cmp -s "$DOCKER_COMPOSE_DIRECTORY/Caddyfile" <(git show HEAD:"Caddyfile"); then
     echo "Caddyfile has changed. Updating local copy..."
     git show HEAD:"Caddyfile" > "$DOCKER_COMPOSE_DIRECTORY/Caddyfile"
+    CADDY_RESTART_NEEDED=true
 else
     echo "Caddyfile has not changed. No action needed."
 fi
@@ -59,4 +60,11 @@ else
     echo "$DOCKER_COMPOSE_FILENAME has not changed. No action needed."
 fi
 
+if [ "$CADDY_RESTART_NEEDED" = true ]; then
+    echo "Restarting Caddy container to apply new configuration..."
+    docker compose restart caddy
+else
+    echo "Caddy configuration has not changed. No restart needed."
+fi
+
 echo "Minutely cron job completed."
\ No newline at end of file
This page took 0.040617 seconds and 4 git commands to generate.