123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #!/usr/bin/env bash
- set -e
- source $SNAP/helper/functions
- SERVER_SSL=$(snapctl get server.ssl)
- SERVER_PORT=$(snapctl get server.port)
- COOKIE_SECURE=$(snapctl get sessio.cookie-secure)
- if [ $(echo "${SERVER_PORT}" | grep -E "^\-?[0-9]+$") = "" ]; then
- echo "!! server.port must be numeric, got ${SERVER_PORT}" >&2
- exit 1
- fi
- if [ ${SERVER_SSL} != true -a ${SERVER_SSL} != false ]; then
- echo "!! server.ssl must be boolean value" >&2
- exit 1
- fi
- if [ ${COOKIE_SECURE} != true -a ${COOKIE_SECURE} != false ]; then
- echo "!! session.cookie-secure must be boolean value" >&2
- exit 1
- fi
- test_default_config
- RUNNING=$(snapctl services | grep "${SNAP_NAME}" | grep inactive | wc -l)
- if [ ${RUNNING} -eq 0 ]; then
- echo "Restarting ${SNAP_NAME}"
- snapctl restart "${SNAP_NAME}"
- fi
|