if (file_exists($my_jail['jailpath'] . "etc/make.conf")) {
                     exec("mv " . $my_jail['jailpath'] . "etc/make.conf " . $my_jail['jailpath'] . "etc/make.conf.bak");
                 }
                 // Move the non-standard make file
                 exec("cp " . $brig_root . "conf/make.conf " . $my_jail['jailpath'] . "etc/");
             }
             // end of "found a match within the checkbox list"
         }
         // end of else
     }
     // end of foreach jail
 }
 // end of "clicked submit"
 if (isset($pconfig['port_op']) && $pconfig['port_op']) {
     // We want to fetch AND extract the tree for the first time
     $response = thebrig_portsnap($brig_root . "conf/ports", $brig_port_db, $brig_root . "conf/portsnap.conf", $pconfig['port_op']);
     if ($response == 1) {
         $input_errors[] = "Something bad happened while attempting to prep for the update operation";
     } elseif ($response == 2) {
         $input_errors[] = "Something bad happened while attempting to return Nas4Free to its previous state";
     }
 }
 // There are no input errors detected.
 if (!$input_errors) {
     // We have specified a new location for thebrig's installation, and it's valid, and we don't already have
     if ($config_changed) {
         write_config();
         write_rcconflocal();
     }
     // Whatever we did, we did it successfully
     $retval = 0;
示例#2
0
#!/usr/local/bin/php-cgi -f
<?php 
/*
*/
require_once "/etc/inc/config.inc";
$brig_root = $config['thebrig']['rootfolder'];
require_once "/usr/local/www/ext/thebrig/functions.inc";
$brig_port_db = $brig_root . "conf/db/ports/";
sleep(rand(0, 3600));
$brig_update_ready = thebrig_update_prep();
if ($brig_update_ready == 0) {
    $response = thebrig_portsnap($brig_root . "conf/ports", $brig_root . "conf/db/ports", $brig_root . "conf/portsnap.conf", "Fetch");
}