Commit 9921aeaf authored by Ad Schellevis's avatar Ad Schellevis

fix merge issues

parent eedc3350
...@@ -101,14 +101,6 @@ function parse_config_bootup() ...@@ -101,14 +101,6 @@ function parse_config_bootup()
log_error("Last known config found and restored. Please double check your configuration file for accuracy."); log_error("Last known config found and restored. Please double check your configuration file for accuracy.");
file_notice("config.xml", gettext("Last known config found and restored. Please double check your configuration file for accuracy."), "pfSenseConfigurator", ""); file_notice("config.xml", gettext("Last known config found and restored. Please double check your configuration file for accuracy."), "pfSenseConfigurator", "");
} }
if (!file_exists($config_xml)) {
echo sprintf(gettext("XML configuration file not found. %s cannot continue booting."), $g['product_name']) . "\n";
unlock($lockkey);
mwexec("/sbin/halt");
exit;
}
log_error("Last known config found and restored. Please double check your configuration file for accuracy.");
file_notice("config.xml", gettext("Last known config found and restored. Please double check your configuration file for accuracy."), "pfSenseConfigurator", "");
} else { } else {
log_error(gettext("Could not find a usable configuration file! Exiting....")); log_error(gettext("Could not find a usable configuration file! Exiting...."));
exit(0); exit(0);
......
...@@ -1217,6 +1217,7 @@ ...@@ -1217,6 +1217,7 @@
if($successful_update == true) { if($successful_update == true) {
/* Write WAN IP to cache file */ /* Write WAN IP to cache file */
$wan_ip = $this->_checkIP(); $wan_ip = $this->_checkIP();
conf_mount_rw();
if ($this->_useIPv6 == false && $wan_ip > 0) { if ($this->_useIPv6 == false && $wan_ip > 0) {
$currentTime = time(); $currentTime = time();
notify_all_remote(sprintf(gettext("DynDNS updated IP Address on %s (%s) to %s"), convert_real_interface_to_friendly_descr($this->_if), $this->_if, $wan_ip)); notify_all_remote(sprintf(gettext("DynDNS updated IP Address on %s (%s) to %s"), convert_real_interface_to_friendly_descr($this->_if), $this->_if, $wan_ip));
...@@ -1231,6 +1232,7 @@ ...@@ -1231,6 +1232,7 @@
@file_put_contents($this->_cacheFile_v6, "{$wan_ip}|{$currentTime}"); @file_put_contents($this->_cacheFile_v6, "{$wan_ip}|{$currentTime}");
} else } else
@unlink($this->_cacheFile_v6); @unlink($this->_cacheFile_v6);
conf_mount_ro();
} }
$this->status = $status; $this->status = $status;
log_error($status); log_error($status);
...@@ -1305,8 +1307,10 @@ ...@@ -1305,8 +1307,10 @@
$initial = false; $initial = false;
$log_error .= "Cached IPv6: {$cacheIP} "; $log_error .= "Cached IPv6: {$cacheIP} ";
} else { } else {
conf_mount_rw();
$cacheIP = '::'; $cacheIP = '::';
@file_put_contents($this->_cacheFile, "::|{$currentTime}"); @file_put_contents($this->_cacheFile, "::|{$currentTime}");
conf_mount_ro();
$cacheTime = $currentTime; $cacheTime = $currentTime;
$initial = true; $initial = true;
$log_error .= "No Cached IPv6 found."; $log_error .= "No Cached IPv6 found.";
...@@ -1319,8 +1323,10 @@ ...@@ -1319,8 +1323,10 @@
$initial = false; $initial = false;
$log_error .= "Cached IP: {$cacheIP} "; $log_error .= "Cached IP: {$cacheIP} ";
} else { } else {
conf_mount_rw();
$cacheIP = '0.0.0.0'; $cacheIP = '0.0.0.0';
@file_put_contents($this->_cacheFile, "0.0.0.0:{$currentTime}"); @file_put_contents($this->_cacheFile, "0.0.0.0:{$currentTime}");
conf_mount_ro();
$cacheTime = $currentTime; $cacheTime = $currentTime;
$initial = true; $initial = true;
$log_error .= "No Cached IP found."; $log_error .= "No Cached IP found.";
...@@ -1370,9 +1376,11 @@ ...@@ -1370,9 +1376,11 @@
*/ */
function _debug($data) { function _debug($data) {
$string = date('m-d-y h:i:s').' - ('.$this->_debugID.') - ['.$this->_dnsService.'] - '.$data."\n"; $string = date('m-d-y h:i:s').' - ('.$this->_debugID.') - ['.$this->_dnsService.'] - '.$data."\n";
conf_mount_rw();
$file = fopen($this->_debugFile, 'a'); $file = fopen($this->_debugFile, 'a');
fwrite($file, $string); fwrite($file, $string);
fclose($file); fclose($file);
conf_mount_ro();
} }
function _checkIP() { function _checkIP() {
if ($this->_useIPv6 == true) { if ($this->_useIPv6 == true) {
......
...@@ -400,8 +400,6 @@ if ($_POST['apply']) { ...@@ -400,8 +400,6 @@ if ($_POST['apply']) {
if (!is_subsystem_dirty('interfaces')) { if (!is_subsystem_dirty('interfaces')) {
$intput_errors[] = gettext("You have already applied your settings!"); $intput_errors[] = gettext("You have already applied your settings!");
} else { } else {
unlink_if_exists('/tmp/config.cache');
clear_subsystem_dirty('interfaces'); clear_subsystem_dirty('interfaces');
if (file_exists('/tmp/.interfaces.apply')) { if (file_exists('/tmp/.interfaces.apply')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment