summaryrefslogtreecommitdiffstats
path: root/snap-src/bin/caddy-control
blob: 1905603ccd1fc52a8c3b9c60146fbfa0cf0b77e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
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} -agree
else
    echo "caddy is disabled. Stop service"
    snapctl stop --disable ${SNAP_NAME}.caddy
    # sleep here, in case snapctl fails to stop service so we do not restart too often
fi