diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-10-12 01:10:10 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-10-12 01:10:10 +0000 |
commit | f19d3b7ada0cb2ae5f688a066be5f76120271058 (patch) | |
tree | 2aca72bf079c3a379441ddc07a0380c348130506 /etc/inc | |
parent | dcf0598edd712f032e564f6c3bee0ac446a4c397 (diff) | |
download | pfsense-f19d3b7ada0cb2ae5f688a066be5f76120271058.zip pfsense-f19d3b7ada0cb2ae5f688a066be5f76120271058.tar.gz |
Move global $config, $g; before check
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/services.inc | 55 | ||||
-rw-r--r-- | etc/inc/system.inc | 48 |
2 files changed, 52 insertions, 51 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 430872d..1869504 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -34,11 +34,11 @@ require_once("functions.inc"); require_once("dyndns.class"); function services_dhcpd_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "services_dhcpd_configure($if) being called $mt\n";; + echo "services_dhcpd_configure($if) being called $mt\n"; } - global $config, $g; /* kill any running dhcpd */ killbypid("{$g['varrun_path']}/dhcpd.pid"); @@ -263,11 +263,11 @@ EOD; } function interfaces_staticarp_configure($if) { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "interfaces_staticarp_configure($if) being called $mt\n"; } - global $config, $g; $ifcfg = $config['interfaces'][$if]; @@ -292,11 +292,11 @@ function interfaces_staticarp_configure($if) { } function services_dhcrelay_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "services_dhcrelay_configure() being called $mt\n" + echo "services_dhcrelay_configure() being called $mt\n"; } - global $config, $g; /* kill any running dhcrelay */ killbypid("{$g['varrun_path']}/dhcrelay.pid"); @@ -366,11 +366,11 @@ function services_dhcrelay_configure() { } function services_dyndns_reset() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "services_dyndns_reset() being called $mt\n" - } - global $config, $g; + echo "services_dyndns_reset() being called $mt\n"; + } if (file_exists("{$g['vardb_path']}/ez-ipupdate.cache")) { unlink("{$g['vardb_path']}/ez-ipupdate.cache"); @@ -386,13 +386,12 @@ function services_dyndns_reset() { } function services_dyndns_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "services_dyndns_configure() being called $mt\n" + echo "services_dyndns_configure() being called $mt\n"; } - global $config, $g; - $dyndnscfg = $config['dyndns']; $wancfg = $config['interfaces']['wan']; @@ -428,12 +427,11 @@ function services_dyndns_configure() { } function services_dyndns_configure_old() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "services_dyndns_configure_old() being called $mt\n" - } - - global $config, $g; + echo "services_dyndns_configure_old() being called $mt\n"; + } /* kill any running ez-ipupdate */ /* ez-ipupdate needs SIGQUIT instead of SIGTERM */ @@ -512,13 +510,12 @@ EOD; function services_dnsmasq_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "services_dnsmasq_configure() being called $mt\n" + echo "services_dnsmasq_configure() being called $mt\n"; } - global $config, $g; - /* kill any running dnsmasq */ sigkillbypid("{$g['varrun_path']}/dnsmasq.pid", "TERM"); @@ -561,11 +558,11 @@ function services_dnsmasq_configure() { } function services_snmpd_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "services_snmpd_configure() being called $mt\n" - } - global $config, $g; + echo "services_snmpd_configure() being called $mt\n"; + } /* kill any running snmpd */ sigkillbypid("{$g['varrun_path']}/snmpd.pid", "TERM"); @@ -709,14 +706,13 @@ EOD; return 0; } -function services_proxyarp_configure() { +function services_proxyarp_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "services_proxyarp_configure() being called $mt\n" + echo "services_proxyarp_configure() being called $mt\n"; } - global $config, $g; - /* kill any running choparp */ killbyname("choparp"); @@ -762,12 +758,12 @@ function services_proxyarp_configure() { } function services_dnsupdate_process() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "services_dnsupdate_process() being called $mt\n" + echo "services_dnsupdate_process() being called $mt\n"; } - global $config, $g; - + /* Dynamic DNS updating active? */ if (isset($config['dnsupdate']['enable'])) { @@ -836,9 +832,10 @@ EOD; } function setup_wireless_olsr($interface) { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "setup_wireless_olsr($interface) being called $mt\n" + echo "setup_wireless_olsr($interface) being called $mt\n"; } $fd = fopen("{$g['varetc_path']}/{$interface}_olsr.conf", "w"); $olsr .= <<<EOD diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 2e38cb2..946cafb 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -33,11 +33,11 @@ require_once("functions.inc"); function system_resolvconf_generate($dynupdate = false) { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_resolvconf_generate() being called $mt\n"; } - global $config, $g; $syscfg = $config['system']; @@ -86,11 +86,11 @@ function system_resolvconf_generate($dynupdate = false) { } function system_hosts_generate() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_hosts_generate() being called $mt\n"; - } - global $config, $g; + } $syscfg = $config['system']; $lancfg = $config['interfaces']['lan']; @@ -126,11 +126,11 @@ EOD; } function system_hostname_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_hostname_configure() being called $mt\n"; - } - global $config, $g; + } $syscfg = $config['system']; @@ -140,12 +140,12 @@ function system_hostname_configure() { } function system_routing_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_routing_configure() being called $mt\n"; } - global $config, $g; - + /* Enable fast routing, if enabled */ if(isset($config['staticroutes']['enablefastrouting'])) mwexec("/sbin/sysctl net.inet.ip.fastforwarding=1"); @@ -189,21 +189,21 @@ function system_routing_configure() { } function system_routing_enable() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_routing_enable() being called $mt\n"; } - global $config, $g; return mwexec("/sbin/sysctl net.inet.ip.forwarding=1"); } function system_syslogd_start() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_syslogd_start() being called $mt\n"; } - global $config, $g; $syslogcfg = $config['syslog']; @@ -304,11 +304,11 @@ EOD; } function system_pccard_start() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_pccard_start() being called $mt\n"; } - global $config, $g; if ($g['booting']) echo "Initializing PCMCIA... "; @@ -331,11 +331,11 @@ function system_pccard_start() { function system_webgui_start() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_webgui_start() being called $mt\n"; } - global $config, $g; if ($g['booting']) echo "Starting webGUI... "; @@ -430,6 +430,8 @@ function system_generate_lighty_config($filename, $cert, $key, $pid_file, $cert_location = "cert.pem", $max_procs, $max_requests = "1", $fast_cgi_enable = true) { + global $config, $g; + if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_generate_lighty_config() being called $mt\n"; @@ -651,12 +653,12 @@ EOD; } function system_password_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_password_configure() being called $mt\n"; - } - global $config, $g; - + } + /* sync passwords */ sync_webgui_passwords(); @@ -666,11 +668,11 @@ function system_password_configure() { } function system_timezone_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_timezone_configure() being called $mt\n"; } - global $config, $g; $syscfg = $config['system']; @@ -694,11 +696,11 @@ function system_timezone_configure() { } function system_ntp_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_ntp_configure() being called $mt\n"; } - global $config, $g; $syscfg = $config['system']; @@ -761,11 +763,11 @@ function system_reboot_cleanup() { } function system_do_shell_commands($early = 0) { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_do_shell_commands() being called $mt\n"; } - global $config, $g; if ($early) $cmdn = "earlyshellcmd"; @@ -788,11 +790,11 @@ function system_do_shell_commands($early = 0) { } function system_console_configure() { + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_console_configure() being called $mt\n"; } - global $config, $g; if (isset($config['system']['disableconsolemenu'])) { touch("{$g['varetc_path']}/disableconsole"); @@ -802,11 +804,11 @@ function system_console_configure() { } function system_dmesg_save() { + global $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_dmesg_save() being called $mt\n"; - } - global $g; + } exec("/sbin/dmesg", $dmesg); @@ -833,11 +835,11 @@ function system_dmesg_save() { } function system_set_harddisk_standby() { + global $g, $config; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_set_harddisk_standby() being called $mt\n"; } - global $g, $config; if (isset($config['system']['harddiskstandby'])) { if ($g['booting']) { @@ -865,11 +867,11 @@ function system_set_harddisk_standby() { } function system_setup_sysctl() { + global $config; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_setup_sysctl() being called $mt\n"; } - global $config; $sysctl = return_filename_as_array("/etc/sysctl.conf"); foreach($sysctl as $sysc) { @@ -882,6 +884,7 @@ function system_setup_sysctl() { } function system_disable_arp_wrong_if() { + global $config; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_disable_arp_wrong_if() being called $mt\n"; @@ -890,6 +893,7 @@ function system_disable_arp_wrong_if() { } function system_enable_arp_wrong_if() { + global $config; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_enable_arp_wrong_if() being called $mt\n"; |