Files
wekan/snap-src/bin/caddy-control
T
2026-05-10 04:54:05 +03:00

20 lines
667 B
Bash
Executable File

#!/bin/bash
if [[ "$PATH" != *"$SNAP_INSTANCE_NAME"* ]]; then
export PATH="${PATH/\/snap\/wekan\//\/snap\/$SNAP_INSTANCE_NAME\/}"
fi
# Get wekan/mongo settings
source $SNAP/bin/wekan-read-settings
if [ "$CADDY_ENABLED" = "true" ]; then
# Use Caddy 2 command format
# The 'host' option is no longer needed in Caddy 2
# The 'agree' option is no longer needed as Caddy 2 doesn't prompt for EULA
env LC_ALL=C caddy run --config $SNAP_COMMON/Caddyfile
else
echo "caddy is disabled. Service stopping disabled"
# snapctl stop --disable ${SNAP_NAME}.caddy
# sleep here, in case snapctl fails to stop service so we do not restart too often
fi