summaryrefslogtreecommitdiffstats
path: root/snap-src/bin/caddy-control
diff options
context:
space:
mode:
Diffstat (limited to 'snap-src/bin/caddy-control')
-rwxr-xr-xsnap-src/bin/caddy-control12
1 files changed, 12 insertions, 0 deletions
diff --git a/snap-src/bin/caddy-control b/snap-src/bin/caddy-control
new file mode 100755
index 00000000..92ce70ba
--- /dev/null
+++ b/snap-src/bin/caddy-control
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# get wekan/mongo settings
+source $SNAP/bin/wekan-read-settings
+
+if [ "$CADDY_ENABLED" = "true" ]; then
+ env LC_ALL=C caddy -conf=$SNAP_COMMON/Caddyfile -host=localhost:${CADDY_PORT}
+else
+ snapctl stop caddy-service 2>&1 || true
+ # sleep here, in case snapctl fails to stop service so we do not restart too often
+ sleep 60
+fi