Przeglądaj źródła

Adding mongodb service control to configure hook

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
Ondrej Kubik 7 lat temu
rodzic
commit
e3bd1c4d23
1 zmienionych plików z 7 dodań i 0 usunięć
  1. 7 0
      snap/hooks/configure

+ 7 - 0
snap/hooks/configure

@@ -22,5 +22,12 @@ else
     snapctl stop --disable ${SNAP_NAME}.caddy 2>&1 || true
 fi
 
+value=$(snapctl get disable-mongodb)
+if [ "$value" = "true" ]; then
+    snapctl stop --disable ${SNAP_NAME}.mongodb 2>&1 || true
+else
+    snapctl start --enable ${SNAP_NAME}.mongodb 2>&1 || true
+fi
+
 # restart all services
 snapctl restart ${SNAP_NAME} 2>&1 || true