Make backup copy of MMDVM.ini before overwriting with new config

This commit is contained in:
Kim Huebel 2017-06-23 18:18:37 +00:00
parent c24b9af234
commit b469c0f380

View file

@ -59,16 +59,19 @@ if (defined("JSONNETWORK")) {
$key = recursive_array_search($netname,$networks); $key = recursive_array_search($netname,$networks);
$network = $networks[$key]; $network = $networks[$key];
setDMRNetwork($network['label']); setDMRNetwork($network['label']);
exec( "sudo cp ".MMDVMINIPATH."/".MMDVMINIFILENAME." ".MMDVMINIPATH."/".MMDVMINIFILENAME .".bak" );
exec( "sudo cp ".MMDVMINIPATH."/".$network['ini'].".ini ".MMDVMINIPATH."/".MMDVMINIFILENAME ); exec( "sudo cp ".MMDVMINIPATH."/".$network['ini'].".ini ".MMDVMINIPATH."/".MMDVMINIFILENAME );
exec( REBOOTMMDVM ); exec( REBOOTMMDVM );
} else { } else {
if ($_GET['network'] == "DMRPLUS") { if ($_GET['network'] == "DMRPLUS") {
setDMRNetwork("DMRplus"); setDMRNetwork("DMRplus");
exec( "sudo cp ".MMDVMINIPATH."/".MMDVMINIFILENAME." ".MMDVMINIPATH."/".MMDVMINIFILENAME .".bak" );
exec( "sudo cp ".MMDVMINIPATH."/DMRPLUS.ini ".MMDVMINIPATH."/".MMDVMINIFILENAME ); exec( "sudo cp ".MMDVMINIPATH."/DMRPLUS.ini ".MMDVMINIPATH."/".MMDVMINIFILENAME );
exec( REBOOTMMDVM ); exec( REBOOTMMDVM );
} }
if ($_GET['network'] == "BRANDMEISTER") { if ($_GET['network'] == "BRANDMEISTER") {
setDMRNetwork("BrandMeister"); setDMRNetwork("BrandMeister");
exec( "sudo cp ".MMDVMINIPATH."/".MMDVMINIFILENAME." ".MMDVMINIPATH."/".MMDVMINIFILENAME .".bak" );
exec( "sudo cp ".MMDVMINIPATH."/BRANDMEISTER.ini ".MMDVMINIPATH."/".MMDVMINIFILENAME ); exec( "sudo cp ".MMDVMINIPATH."/BRANDMEISTER.ini ".MMDVMINIPATH."/".MMDVMINIFILENAME );
exec( REBOOTMMDVM ); exec( REBOOTMMDVM );
} }