diff options
author | doktornotor <notordoktor@gmail.com> | 2015-11-21 20:56:47 +0100 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-11-21 20:56:47 +0100 |
commit | 59aac1588963567c3e907085ff651138b2743020 (patch) | |
tree | 4532347ec737ec76300a1dda54ddb7810c73f7bb | |
parent | 018d14b1df651ff100b92823c620205d26887374 (diff) | |
download | pfsense-packages-59aac1588963567c3e907085ff651138b2743020.tar.gz pfsense-packages-59aac1588963567c3e907085ff651138b2743020.tar.bz2 pfsense-packages-59aac1588963567c3e907085ff651138b2743020.zip |
Do not restart asterisk on boot
-rw-r--r-- | config/asterisk/asterisk.inc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/config/asterisk/asterisk.inc b/config/asterisk/asterisk.inc index ed835b25..899fc370 100644 --- a/config/asterisk/asterisk.inc +++ b/config/asterisk/asterisk.inc @@ -28,6 +28,10 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +require_once("config.inc"); +require_once("service-utils.inc"); +require_once("util.inc"); + define('ASTERISK_CONF_DIR', '/conf/asterisk'); $pf_version=substr(trim(file_get_contents("/etc/version")), 0, 3); if ($pf_version == "2.1" || $pf_version == "2.2") { @@ -43,6 +47,7 @@ function asterisk_install() { } function sync_package_asterisk() { + global $g; conf_mount_rw(); // For NanoBSD compatibility, move the /etc/asterisk configuration directory to /conf, and symlink it back @@ -401,13 +406,26 @@ EOF; 'start' => $start, 'stop' => $stop )); - restart_service("asterisk"); - // Prepare backup for factory defaults restoring feature if (!file_exists("/conf.default/asterisk_factory_defaults_config.tgz")) { system("cd /conf/asterisk/ && /usr/bin/tar czf /conf.default/asterisk_factory_defaults_config.tgz *"); } + /* Do not (re)start the service on boot */ + if (function_exists("platform_booting")) { + if (platform_booting()) { + return; + } + } elseif ($g['booting']) { + return; + } else { + if (is_service_running("asterisk")) { + restart_service("asterisk"); + } else { + start_service("asterisk"); + } + } + conf_mount_ro(); } |