Browse Source

Adding mongodb service control to configure hook

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
Ondrej Kubik 7 years ago
parent
commit
e3bd1c4d23
1 changed files with 7 additions and 0 deletions
  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