aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormcrane <mctch@yahoo.com>2009-04-30 16:32:59 -0600
committermcrane <mctch@yahoo.com>2009-04-30 16:32:59 -0600
commit6911a4803dcf5a8eea3c0f3d1b000a80be4b97cd (patch)
tree0e299989428fd8c281b945959e5bd954ef231765
parente96fad36fd611e877fe1467ad2e40f51637a4c73 (diff)
downloadpfsense-packages-6911a4803dcf5a8eea3c0f3d1b000a80be4b97cd.tar.gz
pfsense-packages-6911a4803dcf5a8eea3c0f3d1b000a80be4b97cd.tar.bz2
pfsense-packages-6911a4803dcf5a8eea3c0f3d1b000a80be4b97cd.zip
FreeSWITCH change backup directory for install to the new directory /root/backup
-rw-r--r--config/freeswitch/freeswitch.inc29
-rw-r--r--config/freeswitch/freeswitch_status.tmp30
2 files changed, 32 insertions, 27 deletions
diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc
index f3d432f0..fd7a2041 100644
--- a/config/freeswitch/freeswitch.inc
+++ b/config/freeswitch/freeswitch.inc
@@ -2271,25 +2271,28 @@ function freeswitch_php_install_command()
// if backup file exists restore it
$filename = 'freeswitch.bak.tgz';
-
+ if (!is_dir('/root/backup/')) {
+ exec("mkdir /root/backup/");
+ }
+
//extract a specific directory to /usr/local/freeswitch
- if (file_exists('/tmp/'.$filename)) {
+ if (file_exists('/root/backup/'.$filename)) {
//echo "The file $filename exists";
//Recommended
- system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/db/');
- system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/log/');
- system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/recordings/');
- system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/scripts/');
- system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/storage/');
- system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/sounds/custom/8000/');
- system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/sounds/music/8000/');
- system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/conf/ssl');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/db/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/log/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/recordings/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/scripts/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/storage/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/custom/8000/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/music/8000/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/ssl');
//Optional
- //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/conf/');
- //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/grammar/');
- //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/htdocs/');
+ //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/');
+ //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/grammar/');
+ //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/htdocs/');
unset($filename);
}
diff --git a/config/freeswitch/freeswitch_status.tmp b/config/freeswitch/freeswitch_status.tmp
index 7c13f44f..0fa3f6f8 100644
--- a/config/freeswitch/freeswitch_status.tmp
+++ b/config/freeswitch/freeswitch_status.tmp
@@ -70,20 +70,22 @@ if ($_GET['a'] == "other") {
if (file_exists('/root/backup/'.$filename)) {
//echo "The file $filename exists";
- //Recommended
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/db/');
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/log/');
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/recordings/');
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/scripts/');
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/storage/');
-
- //Optional
- //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/');
- //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/grammar/');
- //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/htdocs/');
- //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/');
-
- header( 'Location: freeswitch_status.php?savemsg=Backup+has+been+restored.' ) ;
+ //Recommended
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/db/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/log/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/recordings/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/scripts/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/storage/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/custom/8000/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/music/8000/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/ssl');
+
+ //Optional
+ //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/');
+ //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/grammar/');
+ //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/htdocs/');
+
+ header( 'Location: freeswitch_status.php?savemsg=Backup+has+been+restored.' ) ;
}
else {
header( 'Location: freeswitch_status.php?savemsg=Restore+failed.+Backup+file+not+found.' ) ;