0
0
Fork 0
mirror of https://github.com/etlegacy/etlegacy-snap.git synced 2025-04-13 04:51:06 +00:00
etlegacy-snap/snap/hooks/configure

21 lines
442 B
Text
Raw Permalink Normal View History

#!/bin/bash
set -euo pipefail
daemon=$(snapctl get daemon)
case "$daemon" in
true)
# start the daemon
if snapctl services "$SNAP_INSTANCE_NAME" | grep -q inactive; then
snapctl start --enable "$SNAP_INSTANCE_NAME" 2>&1 || true
fi
;;
false)
# stop the daemon
snapctl stop --disable "$SNAP_INSTANCE_NAME" 2>&1 || true
;;
*)
echo "ERROR: Set 'daemon' to one of true|false"
exit 1
;;
esac