aboutsummaryrefslogtreecommitdiffstats
path: root/config/asterisk
diff options
context:
space:
mode:
authornagyrobi <robreg@zsurob.hu>2013-09-21 19:32:30 +0200
committernagyrobi <robreg@zsurob.hu>2013-09-21 19:32:30 +0200
commit74ccdc659710148e22285ee4fdd28adbb6e2ac77 (patch)
treebe6fb904de009a424e8802dc0088ba9f30f5b193 /config/asterisk
parent0ecef974e8def9988a2be695e7bad2575e25792f (diff)
downloadpfsense-packages-74ccdc659710148e22285ee4fdd28adbb6e2ac77.tar.gz
pfsense-packages-74ccdc659710148e22285ee4fdd28adbb6e2ac77.tar.bz2
pfsense-packages-74ccdc659710148e22285ee4fdd28adbb6e2ac77.zip
Update asterisk.inc
Add config move routine for non-pbi install; prepare a backup file to restore Asterisk's settings to factory defaults later.
Diffstat (limited to 'config/asterisk')
-rw-r--r--config/asterisk/asterisk.inc9
1 files changed, 7 insertions, 2 deletions
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();
}