diff options
author | Renato Botelho <renato@netgate.com> | 2015-11-23 08:41:00 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-11-23 08:41:00 -0200 |
commit | 11ff96371de9923bce3ebbca594831cf8f2452f7 (patch) | |
tree | eb9ed2effa56fc7a3cca829550fe0581692276c2 /config | |
parent | 942d92c0b2cfd5ed0a54fa35f5a6006155aa4304 (diff) | |
parent | 86060cc98bfc6c65bb6181ac011cc5a928978fff (diff) | |
download | pfsense-packages-11ff96371de9923bce3ebbca594831cf8f2452f7.tar.gz pfsense-packages-11ff96371de9923bce3ebbca594831cf8f2452f7.tar.bz2 pfsense-packages-11ff96371de9923bce3ebbca594831cf8f2452f7.zip |
Merge pull request #1191 from doktornotor/patch-2
Diffstat (limited to 'config')
-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(); } |