wekan/snap-src/bin/caddy-control
Ondrej Kubik fd47e10e52 Tuning services life cycle
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2018-02-22 13:14:03 +00:00

12 lines
383 B
Bash
Executable file

#!/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
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