Exemple #1
0
## if true, display, if false, hide it ...
if (file_exists("/usr/sbin/swapinfo")) {
    $swapinfo = `/usr/sbin/swapinfo`;
    if (stristr($swapinfo, '%') == true) {
        $showswap = true;
    }
}
## User recently restored his config.
## If packages are installed lets resync
if (file_exists('/conf/needs_package_sync')) {
    if ($config['installedpackages'] != '' && is_array($config['installedpackages']['package'])) {
        if ($g['platform'] == "pfSense" || $g['platform'] == "nanobsd") {
            ## If the user has logged into webGUI quickly while the system is booting then do not redirect them to
            ## the package reinstall page. That is about to be done by the boot script anyway.
            ## The code in fbegin.inc will put up a notice to the user.
            if (!platform_booting()) {
                header('Location: pkg_mgr_install.php?mode=reinstallall');
                exit;
            }
        }
    } else {
        conf_mount_rw();
        @unlink('/conf/needs_package_sync');
        conf_mount_ro();
    }
}
## If it is the first time webConfigurator has been
## accessed since initial install show this stuff.
if (file_exists('/conf/trigger_initial_wizard')) {
    $lang_code = system_get_language_code();
    $lang_codeset = system_get_language_codeset();
	1. Redistributions of source code must retain the above copyright notice,
	   this list of conditions and the following disclaimer.

	2. Redistributions in binary form must reproduce the above copyright
	   notice, this list of conditions and the following disclaimer in the
	   documentation and/or other materials provided with the distribution.

	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
	POSSIBILITY OF SUCH DAMAGE.
*/
require_once "globals.inc";
require_once "servicewatchdog.inc";
global $g;
/* Do nothing at bootup. */
if (function_exists("platform_booting")) {
    if (platform_booting()) {
        return;
    }
} elseif ($g['booting']) {
    return;
}
servicewatchdog_check_services();