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
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