Merge branch 'master' into gettext

This commit is contained in:
Renato Botelho 2010-04-29 08:07:25 -03:00
commit 649bc342dd
4 changed files with 115 additions and 20 deletions

View File

@ -1101,7 +1101,7 @@ function filter_nat_rules_generate() {
// Open inetd.conf write handle
$inetd_fd = fopen("/var/etc/inetd.conf","w");
/* add tftp protocol helper */
fwrite($inetd_fd, "tftp-proxy\tdgram\tudp\twait\t\troot\t/usr/local/sbin/tftp-proxy\ttftp-proxy -v\n");
fwrite($inetd_fd, "tftp-proxy\tdgram\tudp\twait\t\troot\t/usr/libexec/tftp-proxy\ttftp-proxy -v\n");
if(isset($config['nat']['rule'])) {
if(!isset($config['system']['disablenatreflection'])) {

View File

@ -1096,9 +1096,9 @@ function setup_serial_port() {
foreach($ttys_split as $tty) {
if(stristr($tty, "ttyd0") or stristr($tty, "ttyu0")) {
if(isset($config['system']['enableserial'])) {
fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" dialup on secure\n");
fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" cons25 on secure\n");
} else {
fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" dialup off secure\n");
fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" cons25 off secure\n");
}
} else {
fwrite($fd, $tty . "\n");

View File

@ -48,10 +48,18 @@ if(file_exists("/root/cvssync_backup.tgz")) {
$branches = array_merge($branches, $tmp);
}
if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) {
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url", $output_str, $ret);
if(is_array($output_str) && !empty($output_str[0]))
$GIT_REPO = $output_str[0];
unset($output_str);
}
if($command_split[2]) {
$branch = $command_split[2];
} else {
if(!$argv[3]) {
echo "\nCurrent repository is $GIT_REPO\n";
echo "\nPlease select which branch you would like to sync against:\n\n";
foreach($branches as $branchname => $branchdesc) {
echo "{$branchname} \t {$branchdesc}\n";
@ -97,6 +105,21 @@ if(!$found) {
}
}
$merge_repos = array();
if(!$command_split[2] && !$argv[3]) {
do {
echo "\nAdd a custom RCS branch URL (HTTP) to merge in or press enter for none.\n\n";
$merge_repo = readline("> ");
if(!empty($merge_repo)) {
$merge_branch = readline("Merge which branch [master]? ");
if($merge_branch == "")
$merge_repos[] = array('repo' => $merge_repo, 'branch' => 'master');
else if($merge_branch)
$merge_repos[] = array('repo' => $merge_repo, 'branch' => $merge_branch);
}
} while(!empty($merge_repo));
}
if($branch == "RESTORE" && $g['platform'] == "pfSense") {
if(!file_exists("/root/cvssync_backup.tgz")) {
echo "Sorry, we could not find a previous CVSSync backup file.\n";
@ -125,25 +148,15 @@ exec("mkdir -p /root/pfsense/$branch");
// Git 'er done!
if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) {
echo "===> Fetching updates...\n";
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url $GIT_REPO");
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git fetch");
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git clean -f -f -x -d");
if($branch == "master") {
$git_cmd = array(
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset HEAD --hard",
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git rebase origin"
);
run_cmds($git_cmd);
} else {
$git_cmd = array(
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset HEAD --hard",
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout master",
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git branch -D $branch",
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git fetch",
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git rebase origin",
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout -b $branch origin/$branch"
);
run_cmds($git_cmd);
}
$git_cmd = array(
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git branch $branch origin/$branch 2>/dev/null",
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout -f $branch 2>/dev/null",
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset --hard origin/$branch"
);
run_cmds($git_cmd);
} else {
exec("mkdir -p $CODIR/pfSenseGITREPO");
echo "Executing cd $CODIR/pfSenseGITREPO && git clone $GIT_REPO pfSenseGITREPO\n";
@ -159,6 +172,17 @@ if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) {
}
}
foreach($merge_repos as $merge_repo) {
echo "===> Merging branch {$merge_repo['branch']} from {$merge_repo['repo']}\n";
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git pull {$merge_repo['repo']} {$merge_repo['branch']}", $output_str, $ret);
unset($output_str);
if($ret <> 0) {
echo "\nMerge failed. Aborting sync.\n\n";
run_cmds($git_cmd);
exit;
}
}
exec("mkdir -p /tmp/lighttpd/cache/compress/");
// Nuke CVS and pfSense tarballs

View File

@ -136,6 +136,77 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") {
$a_out[] = $natent;
}
}
/* PPTP subnet */
if($config['pptpd']['mode'] == "server") {
if (is_ipaddr($config['pptpd']['localip'])) {
if($config['pptpd']['pptp_subnet'] <> "")
$ossubnet = $config['pptpd']['pptp_subnet'];
else
$ossubnet = "32";
$osn = gen_subnet($config['pptpd']['localip'], $osn);
$natent = array();
$natent['source']['network'] = "{$osn}/{$ossubnet}";
$natent['sourceport'] = "";
$natent['descr'] = "Auto created rule for PPTP server";
$natent['target'] = "";
$natent['interface'] = "pptp";
$natent['destination']['any'] = true;
$natent['natport'] = "";
$a_out[] = $natent;
}
}
/* PPPoE subnet */
if($config['pppoe']['mode'] == "server") {
if (is_ipaddr($config['pppoe']['localip'])) {
if($config['pppoe']['pppoe_subnet'] <> "")
$ossubnet = $config['pppoe']['pptp_subnet'];
else
$ossubnet = "32";
$osn = gen_subnet($config['pppoe']['localip'], $osn);
$natent = array();
$natent['source']['network'] = "{$osn}/{$ossubnet}";
$natent['sourceport'] = "";
$natent['descr'] = "Auto created rule for PPPoE server";
$natent['target'] = "";
$natent['interface'] = "pppoe";
$natent['destination']['any'] = true;
$natent['natport'] = "";
$a_out[] = $natent;
}
}
/* L2TP subnet */
if($config['l2tp']['mode'] == "server") {
if (is_ipaddr($config['l2tp']['localip'])) {
if($config['l2tp']['l2tp_subnet'] <> "")
$ossubnet = $config['l2tp']['pptp_subnet'];
else
$ossubnet = "32";
$osn = gen_subnet($config['l2tp']['localip'], $osn);
$natent = array();
$natent['source']['network'] = "{$osn}/{$ossubnet}";
$natent['sourceport'] = "";
$natent['descr'] = "Auto created rule for L2TP server";
$natent['target'] = "";
$natent['interface'] = "l2tp";
$natent['destination']['any'] = true;
$natent['natport'] = "";
$a_out[] = $natent;
}
}
/* add openvpn interfaces */
if($config['openvpn']['openvpn-server']) {
foreach ($config['openvpn']['openvpn-server'] as $ovpnsrv) {
$natent = array();
$natent['source']['network'] = $ovpnsrv['tunnel_network'];
$natent['sourceport'] = "";
$natent['descr'] = "Auto created rule for OpenVPN server";
$natent['target'] = "";
$natent['interface'] = "openvpn";
$natent['destination']['any'] = true;
$natent['natport'] = "";
$a_out[] = $natent;
}
}
$savemsg = "Default rules for each interface have been created.";
}
break;