Example #1
0
<?php
if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");}
include_once(dirname(__FILE__).'/ressources/class.templates.inc');
include_once(dirname(__FILE__).'/ressources/class.status.inc');
include_once(dirname(__FILE__).'/ressources/class.os.system.inc');
include_once(dirname(__FILE__).'/framework/class.unix.inc');
include_once(dirname(__FILE__)."/framework/frame.class.inc");
if(preg_match("#--verbose#",implode(" ",$argv))){$GLOBALS["debug"]=true;$GLOBALS["VERBOSE"]=true;}


if($argv[1]=="--detect"){detect_kernels();die();}
if($argv[1]=="--install"){upgrade($argv[2]);die();}

function detect_kernels(){
	$unix=new unix();
	if(!$GLOBALS["VERBOSE"]){
	if(is_file("/usr/share/artica-postfix/ressources/logs/kernel.lst")){
		if($unix->file_time_min("/usr/share/artica-postfix/ressources/logs/kernel.lst")<360){die();}
	}}
	
$users=new usersMenus();
if(($users->LinuxDistriCode<>"DEBIAN") && ($users->LinuxDistriCode<>"UBUNTU")){die();}


$unix=new unix();
$apt_cache=$unix->find_program("apt-cache");




if($apt_cache==null){
<?php

if (posix_getuid() != 0) {
    die("Cannot be used in web server mode\n\n");
}
include_once dirname(__FILE__) . '/ressources/class.templates.inc';
include_once dirname(__FILE__) . '/ressources/class.status.inc';
include_once dirname(__FILE__) . '/ressources/class.os.system.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . "/framework/frame.class.inc";
if (preg_match("#--verbose#", implode(" ", $argv))) {
    $GLOBALS["debug"] = true;
    $GLOBALS["VERBOSE"] = true;
}
if ($argv[1] == "--detect") {
    detect_kernels();
    die;
}
if ($argv[1] == "--install") {
    upgrade($argv[2]);
    die;
}
function detect_kernels()
{
    $unix = new unix();
    if (!$GLOBALS["VERBOSE"]) {
        if (is_file("/usr/share/artica-postfix/ressources/logs/kernel.lst")) {
            if ($unix->file_time_min("/usr/share/artica-postfix/ressources/logs/kernel.lst") < 360) {
                die;
            }
        }