mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-11 11:35:54 +02:00
Merge remote branch 'origin/next' into arm-port
Conflicts: config/rootfiles/common/i586/gcc lfs/binutils lfs/cleanup-toolchain lfs/coreutils lfs/gcc lfs/glibc lfs/groff src/pakfire/pakfire.conf src/patches/gcc-4.1.2-specs-1.patch
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
COREVER=`cat /opt/pakfire/db/core/mine`
|
||||
# FIXME: edit this lines before release
|
||||
URL=http://download.ipfire.org/releases/ipfire-2.x/2.9-core$COREVER/
|
||||
ISO=ipfire-2.9.i586-full-core$COREVER.iso
|
||||
URL=http://download.ipfire.org/releases/ipfire-2.x/2.11-core$COREVER/
|
||||
ISO=ipfire-2.11.i586-full-core$COREVER.iso
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo usage: $0 backup-file
|
||||
|
||||
@@ -515,6 +515,36 @@ if ($ip ne $ipcache) {
|
||||
&General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure (could not connect to server)");
|
||||
}
|
||||
}
|
||||
#namecheap test
|
||||
elsif ($settings{'SERVICE'} eq 'namecheap') {
|
||||
# use proxy ?
|
||||
my %proxysettings;
|
||||
&General::readhash("${General::swroot}/proxy/settings", \%proxysettings);
|
||||
if ($_=$proxysettings{'UPSTREAM_PROXY'}) {
|
||||
my ($peer, $peerport) = (/^(?:[a-zA-Z ]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/);
|
||||
Net::SSLeay::set_proxy($peer,$peerport,$proxysettings{'UPSTREAM_USER'},$proxysettings{'UPSTREAM_PASSWORD'} );
|
||||
}
|
||||
|
||||
my ($out, $response) = Net::SSLeay::get_https( 'dynamicdns.park-your-domain.com',
|
||||
443,
|
||||
"/update?host=$settings{'HOSTNAME'}&domain=$settings{'DOMAIN'}&password=$settings{'PASSWORD'}&ip=$ip",
|
||||
Net::SSLeay::make_headers('User-Agent' => 'IPFire' )
|
||||
);
|
||||
#Valid responses from service are:
|
||||
# wait confirmation!!
|
||||
if ($response =~ m%HTTP/1\.. 200 OK%) {
|
||||
if ( $out !~ m/<ErrCount>0<\/ErrCount>/ ) {
|
||||
$out =~ m/<Err1>(.*)<\/Err1>/;
|
||||
&General::log("Dynamic DNS ip-update for $settings{'HOSTNAME'}.$settings{'DOMAIN'} : failure ($1)");
|
||||
} else {
|
||||
&General::log("Dynamic DNS ip-update for $settings{'HOSTNAME'}.$settings{'DOMAIN'} : success");
|
||||
$success++;
|
||||
}
|
||||
} else {
|
||||
&General::log("Dynamic DNS ip-update for $settings{'HOSTNAME'}.$settings{'DOMAIN'} : failure (could not connect to server)");
|
||||
}
|
||||
}
|
||||
#end namecheap test
|
||||
elsif ($settings{'SERVICE'} eq 'dynu') {
|
||||
# use proxy ?
|
||||
my %proxysettings;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
##################################################
|
||||
##### VPN-Watch.pl Version 0.6a #####
|
||||
##### VPN-Watch.pl Version 0.7 #####
|
||||
##################################################
|
||||
# #
|
||||
# VPN-Watch is part of the IPFire Firewall #
|
||||
@@ -31,18 +31,19 @@ while ( $i == 0){
|
||||
|
||||
$round++;
|
||||
|
||||
# Reset roundcounter after 60 min. To do established check.
|
||||
if ($round > 59) { $round=0; }
|
||||
# Reset roundcounter after 10 min. To do established check.
|
||||
if ($round > 9) { $round=0; }
|
||||
|
||||
if (open(FILE, "<${General::swroot}/vpn/config")) { @vpnsettings = <FILE>;
|
||||
close(FILE);
|
||||
unless(@vpnsettings) {exit 1;}
|
||||
}
|
||||
|
||||
my $status = `ipsec whack --status`;
|
||||
my $status = `ipsec status`;
|
||||
foreach (@vpnsettings){
|
||||
my @settings = split(/,/,$_);
|
||||
|
||||
|
||||
chomp($settings[30]);
|
||||
if ($settings[27] ne 'RED'){next;}
|
||||
if ($settings[4] ne 'net'){next;}
|
||||
if ($settings[1] ne 'on'){next;}chomp($settings[29]);
|
||||
@@ -55,15 +56,13 @@ foreach (@vpnsettings){
|
||||
my $remoteip = `/usr/bin/ping -c 1 $remotehostname 2>/dev/null | head -n1 | awk '{print \$3}' | tr -d '()' | tr -d ':'`;chomp($remoteip);
|
||||
if ($remoteip eq ""){next;if ($debug){logger("Unable to resolve $remotehostname.");}}
|
||||
my $ipmatch= `echo "$status" | grep '$remoteip' | grep '$settings[2]'`;
|
||||
my $established= `echo "$status" | grep '$settings[2]' | grep 'erouted;'`;
|
||||
my $established= `echo "$status" | grep '$settings[2]' | grep -e 'erouted;' -e 'INSTALLED'`;
|
||||
my $known= `echo "$status" | grep '$settings[2]'`;
|
||||
|
||||
if ( $ipmatch eq '' && $known ne '' ){
|
||||
logger("Remote IP for host $remotehostname($remoteip) has changed, restarting ipsec.");
|
||||
system("/usr/local/bin/ipsecctrl S $settings[0]");
|
||||
$round=0;
|
||||
last; #all connections will reloaded
|
||||
#remove this if ipsecctrl can restart single con again
|
||||
}
|
||||
|
||||
if ($debug){logger("Round=".$round." and established=".$established);}
|
||||
@@ -72,8 +71,6 @@ foreach (@vpnsettings){
|
||||
logger("Connection to $remotehostname($remoteip) not erouted, restarting ipsec.");
|
||||
system("/usr/local/bin/ipsecctrl S $settings[0]");
|
||||
$round=0;
|
||||
last; #all connections will reloaded
|
||||
#remove this if ipsecctrl can restart single con again
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user