From 74ccdc659710148e22285ee4fdd28adbb6e2ac77 Mon Sep 17 00:00:00 2001 From: nagyrobi Date: Sat, 21 Sep 2013 19:32:30 +0200 Subject: Update asterisk.inc Add config move routine for non-pbi install; prepare a backup file to restore Asterisk's settings to factory defaults later. --- config/asterisk/asterisk.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'config/asterisk/asterisk.inc') diff --git a/config/asterisk/asterisk.inc b/config/asterisk/asterisk.inc index d3a1cf67..d766c77a 100644 --- a/config/asterisk/asterisk.inc +++ b/config/asterisk/asterisk.inc @@ -62,12 +62,14 @@ function sync_package_asterisk() { system("mv -f /usr/pbi/asterisk-amd64/etc/asterisk/ /conf/asterisk/ && ln -s /conf/asterisk /usr/pbi/asterisk-amd64/etc/asterisk"); } if (file_exists("/conf/asterisk/")) { - //this should occur on all systems v2.0 and up if (file_exists("/usr/local/etc/asterisk/")) { system("mv -f /usr/local/etc/asterisk /usr/local/etc/asterisk.bak"); } system("ln -s /conf/asterisk /usr/local/etc/asterisk"); system("cd /conf/asterisk && mkdir dist && mv *-dist dist"); + } else { + //should reach here only on non-pbi installs (2.0.x) + system("mv -f /usr/local/etc/asterisk/ /conf/asterisk/ && ln -s /conf/asterisk /usr/local/etc/asterisk"); } //fix asterisk options for nanobsd: logging, db and calls log in /tmp @@ -366,7 +368,10 @@ function sync_package_asterisk() { mwexec_bg("$script start"); } - #mount filesystem readonly + //prepare backup for factory defaults + system("cd /conf/asterisk/ && tar czf /conf.default/asterisk_factory_defaults_config.tgz *"); + + //mount filesystem readonly conf_mount_ro(); } -- cgit v1.2.3