Browse Source

Force disable when eol is met

Joachim M. Giæver 1 year ago
parent
commit
96efb7455a
2 changed files with 6 additions and 1 deletions
  1. 5 0
      src/helper/env-wrapper
  2. 1 1
      src/hooks/connect-plug-zui-store

+ 5 - 0
src/helper/env-wrapper

@@ -2,6 +2,11 @@
 
 source $SNAP/helper/functions
 
+if [ -s "${SNAP_COMMON}/.eol" ]; then
+	lprint "Met EOL, disabling... Use ZUI instead «zwave-js-ui», which already should be installed and enabled on your system."
+	snapctl stop --disable "${SNAP_NAME}.${SNAP_NAME}"
+	exit 1
+fi
 
 # WITH S0+n NETWORK KEY IS NOT USED ANYMORE
 #export NETWORK_KEY=$(snapctl get network.key)

+ 1 - 1
src/hooks/connect-plug-zui-store

@@ -23,7 +23,7 @@ if snapctl is-connected zui-store; then
 		if [ -s "${SERVICE_FILE}" ]; then
 			if [ "$(cat "${SERVICE_FILE}")" == "enable" ]; then
 				lprint "ZUI will be enabled. Disable ${SNAP_NAME}."
-				snapctl stop --disable "${SNAP_NAME}.${SNAP_NAME}"
+				touch "${SNAP_COMMON}/.eol"
 				exit 1
 			else
 				lprint "ZUI won't be enabled. Keep ${SNAP_NAME} enabled."