freeswitch-stable: improve autostart prevention 227/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Tue, 26 Dec 2017 13:05:31 +0000 (14:05 +0100)
committerSebastian Kemper <sebastian_ml@gmx.net>
Tue, 26 Dec 2017 13:05:52 +0000 (14:05 +0100)
The current approach (creating a blocker file) is clumsy. Use a variable
in /etc/default/freeswitch instead.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/freeswitch-stable/Makefile
net/freeswitch-stable/files/freeswitch.default
net/freeswitch-stable/files/freeswitch.init

index 0a67fee385fd0fa30028f0a7fcf89518be59d907..eaffe8d0460dd90745bbbc802ab971e08e767a81 100644 (file)
@@ -380,8 +380,10 @@ endef
 define Package/$(PKG_NAME)/postinst
 #!/bin/sh
 if [ -z "$${IPKG_INSTROOT}" ]; then
-  # Prevent autostart of $(PRG_NAME)
-  touch $(FS_STABLE_SYSCONF_DIR)/$(PRG_NAME)_disabled
+  # Prevent $(PRG_NAME) from auto-starting after an upgrade. The modules may
+  # not be upgraded yet and the user configuration may need a revision.
+  sed -i '/^ENABLE_FREESWITCH="yes"/s/^/#/' \
+    $(FS_STABLE_SYSCONF_DIR)/default/$(PRG_NAME)
 
   echo
   echo "o-------------------------------------------------------------------o"
index 3d6e911068243641cdbdf445214c8fde8e7d2e3a..cfea49484ca3b8c28fe0141afd2822da245b7f91 100644 (file)
@@ -1,5 +1,9 @@
 ### FreeSWITCH configuration ###
 
+# Uncomment once you verified your configuration, otherwise the init script will
+# not start FreeSWITCH.
+#ENABLE_FREESWITCH="yes"
+
 #FS_USER=freeswitch
 #FS_GROUP=freeswitch
 
index 6b349b1a00877b80a2c31145d03e2b30ec06d604..c17768c1aa74ec4c844465d7a59eada1624dff4a 100644 (file)
@@ -33,9 +33,9 @@ fs_dir_temp="${FS_DIR_TEMP:-/tmp/$FS/temp}"
 start_service() {
   local dir=
 
-  if [ -f "/etc/${FS}_disabled" ]; then
-    $LOGGER File \"/etc/${FS}_disabled\" exists
-    $LOGGER Remove it once your configuration is set up
+  if [ "$ENABLE_FREESWITCH" != yes ]; then
+    $LOGGER User configuration incomplete - not starting $FS
+    $LOGGER Check ENABLE_FREESWITCH in $DEFAULT
     exit 1
   fi