diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi
index 7567fd06e..734e7dc88 100644
--- a/html/cgi-bin/ids.cgi
+++ b/html/cgi-bin/ids.cgi
@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2005-2010 IPFire Team #
+# Copyright (C) 2005-2011 IPFire Team #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -97,7 +97,7 @@ if (-e "/etc/snort/snort.conf") {
close(FILE);
open(FILE, ">/etc/snort/snort.conf") or die 'Unable to write snort config file.';
- my @rules = `cd /etc/snort/rules/ && ls *.rules`; # With this loop the rule might be display with correct rulepath set
+ my @rules = `cd /etc/snort/rules/ && ls *.rules 2>/dev/null`; # With this loop the rule might be display with correct rulepath set
foreach (@rules) {
chomp $_;
my $temp = join(";",@snortconfig);
diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi
index 6a93b6837..0dcadb0b2 100644
--- a/html/cgi-bin/index.cgi
+++ b/html/cgi-bin/index.cgi
@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2010 IPFire Team #
+# Copyright (C) 2007-2011 IPFire Team #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -58,7 +58,7 @@ my %mainsettings = ();
my $connstate = &Header::connectionstatus();
- if ( -e "/var/ipfire/main/gpl-acceted" ) {
+ if ( -e "/var/ipfire/main/gpl-accepted" ) {
if ($cgiparams{'ACTION'} eq $Lang::tr{'shutdown'} || $cgiparams{'ACTION'} eq $Lang::tr{'reboot'}) {
$refresh = "";
} elsif ($connstate =~ /$Lang::tr{'connecting'}/ || /$Lang::tr{'connection closed'}/ ){
@@ -407,7 +407,7 @@ if ($used / $mem > 90) {
# Diskspace usage warning
my @temp=();
my $temp2=();
-my @df = `/bin/df -B M -x rootfs`;
+my @df = `/bin/df -B M -P -x rootfs`;
foreach my $line (@df) {
next if $line =~ m/^Filesystem/;
if ($line =~ m/root/ ) {
@@ -431,7 +431,7 @@ foreach my $line (@df) {
}
# S.M.A.R.T. health warning
-my @files = `/bin/ls /var/run/smartctl_out_hddtemp-*`;
+my @files = `/bin/ls /var/run/smartctl_out_hddtemp-* 2>/dev/null`;
foreach my $file (@files) {
chomp ($file);
my $disk=`echo $file | cut -d"-" -f2`;
diff --git a/html/cgi-bin/logs.cgi/firewalllog.dat b/html/cgi-bin/logs.cgi/firewalllog.dat
index 5979a7679..466a3cec7 100644
--- a/html/cgi-bin/logs.cgi/firewalllog.dat
+++ b/html/cgi-bin/logs.cgi/firewalllog.dat
@@ -333,7 +333,7 @@ foreach $_ (@log)
my $comment = $3;
my $packet = $4;
- $packet =~ /IN=(\w+)/; my $iface=$1; if ( $1 eq "27" ){ $iface="";}
+ $packet =~ /IN=(\w+)/; my $iface=$1; if ( $1 =~ /2./ ){ $iface="";}
$packet =~ /SRC=([\d\.]+)/; my $srcaddr=$1;
$packet =~ /DST=([\d\.]+)/; my $dstaddr=$1;
$packet =~ /MAC=([\w+\:]+)/; my $macaddr=$1;
diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi
index 6a89ca867..9456c3c22 100644
--- a/html/cgi-bin/media.cgi
+++ b/html/cgi-bin/media.cgi
@@ -70,7 +70,7 @@ if ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" || $querry[0] =~ "xvd??"){
&Header::openbox('100%', 'center', $Lang::tr{'disk usage'});
print "\n";
- open(DF,'/bin/df -B M -x rootfs|');
+ open(DF,'/bin/df -P -B M -x rootfs|');
while(){
if ($_ =~ m/^Filesystem/ ){
print <| \n | Inodes\n";
- open(DF,'/bin/df -i -x rootfs|');
+ open(DF,'/bin/df -P -i -x rootfs|');
while(){
if ($_ =~ m/^Filesystem/ ){
print </dev/null`) {
- $reboot = 1;
-}
-
if ($pakfiresettings{'ACTION'} eq 'install'){
$pakfiresettings{'INSPAKS'} =~ s/\|/\ /g;
if ("$pakfiresettings{'FORCE'}" eq "on") {
@@ -236,7 +230,7 @@ my $packages_update_age = &General::age("/opt/pakfire/db/lists/packages_list.db"
print <
END
-if ($reboot == 1) {
+if ( -e "/var/run/need_reboot") {
print "| $Lang::tr{'needreboot'}! | ";
print "| | "
}
diff --git a/html/cgi-bin/pppsetup.cgi b/html/cgi-bin/pppsetup.cgi
index 0bfeabd1b..e2af0a088 100644
--- a/html/cgi-bin/pppsetup.cgi
+++ b/html/cgi-bin/pppsetup.cgi
@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2007-2011 IPFire Team #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -486,7 +486,7 @@ print </dev/null | grep 0`;
chomp ($atmdev);
if ($atmdev ne '') {
print < #
+# Copyright (C) 2007-2011 IPFire Team #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -82,7 +82,6 @@ my @templist=();
my $cachemem=0;
my $proxy1='';
my $proxy2='';
-my $replybodymaxsize=0;
my $browser_regexp='';
my $needhup = 0;
my $errormessage='';
@@ -3870,19 +3869,18 @@ END
request_body_max_size $proxysettings{'MAX_OUTGOING_SIZE'} KB
END
;
- $replybodymaxsize = 1024 * $proxysettings{'MAX_INCOMING_SIZE'};
if ($proxysettings{'MAX_INCOMING_SIZE'} > 0) {
- if (!-z $acl_src_unrestricted_ip) { print FILE "reply_body_max_size 0 deny IPFire_unrestricted_ips\n"; }
- if (!-z $acl_src_unrestricted_mac) { print FILE "reply_body_max_size 0 deny IPFire_unrestricted_mac\n"; }
+ if (!-z $acl_src_unrestricted_ip) { print FILE "reply_body_max_size none IPFire_unrestricted_ips\n"; }
+ if (!-z $acl_src_unrestricted_mac) { print FILE "reply_body_max_size none IPFire_unrestricted_mac\n"; }
if ($proxysettings{'AUTH_METHOD'} eq 'ncsa')
{
- if (!-z $extgrp) { print FILE "reply_body_max_size 0 deny for_extended_users\n"; }
+ if (!-z $extgrp) { print FILE "reply_body_max_size none for_extended_users\n"; }
}
}
- if ( $replybodymaxsize != '0' )
+ if ( $proxysettings{'MAX_INCOMING_SIZE'} != '0' )
{
- print FILE "reply_body_max_size $replybodymaxsize deny all\n\n";
+ print FILE "reply_body_max_size $proxysettings{'MAX_INCOMING_SIZE'} KB all\n\n";
}
print FILE "visible_hostname";
diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi
index f336ec610..55582952b 100644
--- a/html/cgi-bin/vpnmain.cgi
+++ b/html/cgi-bin/vpnmain.cgi
@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2010 IPFire Team info@ipfire.org #
+# Copyright (C) 2007-2011 IPFire Team info@ipfire.org #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -2400,7 +2400,7 @@ EOF
&General::readhasharray("${General::swroot}/vpn/config", \%confighash);
$cgiparams{'CA_NAME'} = '';
- my @status = `/usr/local/bin/ipsecctrl I`;
+ my @status = `/usr/local/bin/ipsecctrl I 2>/dev/null`;
# suggest a default name for this side
if ($cgiparams{'VPN_IP'} eq '' && -e "${General::swroot}/red/active") {
diff --git a/html/cgi-bin/wlanap.cgi b/html/cgi-bin/wlanap.cgi
index cd5bda3e8..0bb42ae31 100644
--- a/html/cgi-bin/wlanap.cgi
+++ b/html/cgi-bin/wlanap.cgi
@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2005-2010 IPTifre Team #
+# Copyright (C) 2005-2011 IPFire Team #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -242,7 +242,7 @@ $selected{'TXPOWER'}{$wlanapsettings{'TXPOWER'}} = "selected='selected'";
$selected{'HW_MODE'}{$wlanapsettings{'HW_MODE'}} = "selected='selected'";
$selected{'MACMODE'}{$wlanapsettings{'MACMODE'}} = "selected='selected'";
-my @channellist_cmd = `iwlist $wlanapsettings{'INTERFACE'} channel`;
+my @channellist_cmd = `iwlist $wlanapsettings{'INTERFACE'} channel 2>/dev/null`;
# get available channels
my @temp;
@@ -253,7 +253,7 @@ if ( $channel =~ /\d+/ ){push(@temp,$channel);}
}
my @channellist = @temp;
-my @txpower_cmd = `iwlist $wlanapsettings{'INTERFACE'} txpower`;
+my @txpower_cmd = `iwlist $wlanapsettings{'INTERFACE'} txpower 2>/dev/null`;
# get available channels
my @temp;
diff --git a/lfs/configroot b/lfs/configroot
index ff1a2062a..43c2d2155 100644
--- a/lfs/configroot
+++ b/lfs/configroot
@@ -139,4 +139,7 @@ $(TARGET) :
done
chown root:nobody $(CONFIG_ROOT)/dhcpc
+ # Set outgoingfw.pl executable
+ chmod 755 $(CONFIG_ROOT)/outgoing/bin/outgoingfw.pl
+
@$(POSTBUILD)
diff --git a/lfs/fcron b/lfs/fcron
index 5cf9cc5e5..38343d407 100644
--- a/lfs/fcron
+++ b/lfs/fcron
@@ -93,6 +93,15 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
chmod u-s /usr/bin/fcrontab /usr/bin/fcronsighup
mkdir -p /etc/fcron.minutely /etc/fcron.cyclic /etc/fcron.hourly \
/etc/fcron.daily /etc/fcron.weekly /etc/fcron.monthly
+
+ #Create Placeholder files
+ echo "Place scripts run minutely here ..." > /etc/fcron.minutely/info.txt
+ echo "Place scripts run cyclic here ..." > /etc/fcron.cyclic/info.txt
+ echo "Place scripts run hourly here ..." > /etc/fcron.hourly/info.txt
+ echo "Place scripts run daily here ..." > /etc/fcron.daily/info.txt
+ echo "Place scripts run weekly here ..." > /etc/fcron.weekly/info.txt
+ echo "Place scripts run monthly here ..." > /etc/fcron.monthly/info.txt
+
/usr/bin/fcrontab $(DIR_SRC)/config/cron/crontab
@rm -rf $(DIR_APP)
@$(POSTBUILD)
diff --git a/lfs/fireinfo b/lfs/fireinfo
index abc9d848d..6c502e1ff 100644
--- a/lfs/fireinfo
+++ b/lfs/fireinfo
@@ -24,7 +24,7 @@
include Config
-VER = 2.0.2
+VER = 2.0.4
THISAPP = fireinfo-$(VER)
DL_FILE = $(THISAPP).tar.gz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = ed29f591ccfeeb6386a61eafcc5dc398
+$(DL_FILE)_MD5 = 7433e108cce180980189339886621539
install : $(TARGET)
diff --git a/lfs/linux b/lfs/linux
index 1aec51112..26c7b837b 100644
--- a/lfs/linux
+++ b/lfs/linux
@@ -208,5 +208,9 @@ endif
rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/mISDN
rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/hardware/mISDN
+ # Disable geode_aes modul
+ mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/crypto/geode-aes.ko \
+ /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/crypto/geode-aes.ko.off
+
@rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
@$(POSTBUILD)
diff --git a/lfs/memtest b/lfs/memtest
index 5d27047ac..a6179ed36 100644
--- a/lfs/memtest
+++ b/lfs/memtest
@@ -1,7 +1,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2007-2011 IPFire Team #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -24,7 +24,7 @@
include Config
-VER = 4.10
+VER = 4.20
THISAPP = memtest86+-$(VER)
DL_FILE = $(THISAPP).tar.gz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 2144f21d4489a04149b1891b8d97e8fc
+$(DL_FILE)_MD5 = ef62c2f5be616676c8c62066dedc46b3
install : $(TARGET)
diff --git a/lfs/parted b/lfs/parted
new file mode 100644
index 000000000..25db9e5c3
--- /dev/null
+++ b/lfs/parted
@@ -0,0 +1,85 @@
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2011 IPFire Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see . #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER = 2.3
+
+THISAPP = parted-$(VER)
+DL_FILE = $(THISAPP).tar.gz
+DL_FROM = $(URL_IPFIRE)
+DIR_APP = $(DIR_SRC)/$(THISAPP)
+TARGET = $(DIR_INFO)/$(THISAPP)
+
+PROG = parted
+PAK_VER = 1
+
+DEPS = ""
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 30ceb6df7e8681891e865e2fe5a7903d
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist:
+ @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+ @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+ @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+ @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+ @$(PREBUILD)
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+ cd $(DIR_APP) && ./configure --prefix=/usr --disable-device-mapper
+ cd $(DIR_APP) && make $(MAKETUNING)
+ cd $(DIR_APP) && make install
+ @rm -rf $(DIR_APP)
+ @$(POSTBUILD)
diff --git a/lfs/snort b/lfs/snort
index 47b8b5aad..7b5d41bc2 100644
--- a/lfs/snort
+++ b/lfs/snort
@@ -24,7 +24,7 @@
include Config
-VER = 2.9.0.2
+VER = 2.9.0.3
THISAPP = snort-$(VER)
DL_FILE = $(THISAPP).tar.gz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 5d4dabe98bccbea166bbc86e2439f22a
+$(DL_FILE)_MD5 = 5f0c48b06453696ad32e27b9b3dd6603
install : $(TARGET)
diff --git a/lfs/squid b/lfs/squid
index 8b907156f..9bb8b50b8 100644
--- a/lfs/squid
+++ b/lfs/squid
@@ -24,10 +24,10 @@
include Config
-VER = 3.1.8
+VER = 3.1.10
THISAPP = squid-$(VER)
-DL_FILE = $(THISAPP).tar.bz2
+DL_FILE = $(THISAPP).tar.gz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = a8160dfba55ab7c400c622b72d39fc13
+$(DL_FILE)_MD5 = 0a233d8966a563a795065ccb654caa4f
install : $(TARGET)
@@ -69,7 +69,7 @@ $(subst %,%_MD5,$(objects)) :
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xzf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && ./configure --prefix=/usr --disable-nls \
--datadir=/usr/lib/squid \
diff --git a/make.sh b/make.sh
index fe473aeec..13d79e088 100755
--- a/make.sh
+++ b/make.sh
@@ -685,6 +685,7 @@ buildipfire() {
ipfiremake miniupnpd
ipfiremake client175
ipfiremake powertop
+ ipfiremake parted
echo Build on $HOSTNAME > $BASEDIR/build/var/ipfire/firebuild
cat /proc/version >> $BASEDIR/build/var/ipfire/firebuild
echo >> $BASEDIR/build/var/ipfire/firebuild
diff --git a/src/initscripts/init.d/functions b/src/initscripts/init.d/functions
index 00cd6fa2a..e2e058d38 100644
--- a/src/initscripts/init.d/functions
+++ b/src/initscripts/init.d/functions
@@ -27,7 +27,7 @@ KILLDELAY="10"
## Screen Dimensions
# Find current screen size
if [ -z "${COLUMNS}" ]; then
- COLUMNS=$(stty size)
+ COLUMNS=$(stty size 2>/dev/null)
COLUMNS=${COLUMNS##* }
fi
diff --git a/src/install+setup/install/unattended.c b/src/install+setup/install/unattended.c
index 3e2f3f088..77e1eabbd 100644
--- a/src/install+setup/install/unattended.c
+++ b/src/install+setup/install/unattended.c
@@ -150,7 +150,7 @@ int unattended_setup(struct keyvalue *unattendedkv) {
if (strlen(restore_file) > 0) {
fprintf(flog, "unattended: Restoring Backup\n");
snprintf(commandstring, STRING_SIZE,
- "cd /harddisk && /bin/tar -xvzp -f /harddisk/var/ipfire/backup/%s", restore_file);
+ "/usr/sbin/chroot /harddisk /bin/tar -xvzp -f /var/ipfire/backup/%s -C /", restore_file);
if (mysystem(commandstring)) {
errorbox("unattended: ERROR restoring backup");
}
diff --git a/src/scripts/hddshutdown b/src/scripts/hddshutdown
index 28994998b..bb28f830a 100644
--- a/src/scripts/hddshutdown
+++ b/src/scripts/hddshutdown
@@ -1,13 +1,26 @@
#!/usr/bin/perl
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2011 IPFire Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see . #
+# #
+###############################################################################
#
# IPFire HDD Shutdown state reader
#
-# This code is distributed under the terms of the GPL
-#
-# 18.09.2007 Maniacikarus - IPFire.org - maniacikarus@ipfire.org
-# 22.09.2007 Arne_F - fitzenreiter.de - arne@fitzenreiter.de
-
-# begin
my @devices = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
my $diskstats = "";
@@ -20,7 +33,7 @@ if ($debug){print "### Searching for available Disks ###\n";}
foreach (@devices){
chomp $_;
my @array = split(/\//,$_);
- $diskstats = `cat /var/run/hddstats-$array[$#array]`;
+ $diskstats = `cat /var/run/hddstats-$array[$#array] 2>/dev/null`;
chomp $diskstats;
$newdiskstats = `iostat -d -t $_ | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
chomp $newdiskstats;
diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs
index c2baee7cc..97d086a10 100644
--- a/src/scripts/makegraphs
+++ b/src/scripts/makegraphs
@@ -3,7 +3,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2008 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2008-2011 IPFire Team #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -103,7 +103,7 @@ sub updatehdddata{
system ('/usr/bin/vnstat -u');
my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
-system("unlink /var/run/hddstatus && touch /var/run/hddstatus");
+system("unlink /var/run/hddstatus 2>/dev/null && touch /var/run/hddstatus");
foreach (@disks){
my $disk = $_;
chomp $disk;
@@ -114,7 +114,7 @@ foreach (@disks){
my $newdiskstats = "";
my @array = split(/\//,$disk);
- $diskstats = `cat /var/run/hddstats-$array[$#array]`;
+ $diskstats = `cat /var/run/hddstats-$array[$#array] 2>/dev/null`;
chomp $diskstats;
my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
chomp $newdiskstats;
@@ -122,7 +122,7 @@ foreach (@disks){
chomp $status;
if ($status !~/standby/ || $diskstats ne $newdiskstats){
- if (-e "/var/run/hddshutdown-".$array[$#array]){system("unlink /var/run/hddshutdown-".$array[$#array]);}
+ if (-e "/var/run/hddshutdown-".$array[$#array]){system("unlink /var/run/hddshutdown-".$array[$#array]." 2>/dev/null");}
}
if (-e "/var/run/hddshutdown-".$array[$#array]){$status = " standby\n";}
diff --git a/src/scripts/vpn-watch b/src/scripts/vpn-watch
index 0c5f62d59..af646adce 100755
--- a/src/scripts/vpn-watch
+++ b/src/scripts/vpn-watch
@@ -1,6 +1,6 @@
#!/usr/bin/perl
##################################################
-##### VPN-Watch.pl Version 0.5 #####
+##### VPN-Watch.pl Version 0.6a #####
##################################################
# #
# VPN-Watch is part of the IPFire Firewall #
@@ -31,8 +31,8 @@ while ( $i == 0){
$round++;
- # Reset roundcounter after 10 min. To do established check.
- if ($round > 9) { $round=0 }
+ # Reset roundcounter after 60 min. To do established check.
+ if ($round > 59) { $round=0; }
if (open(FILE, "<${General::swroot}/vpn/config")) { @vpnsettings = ;
close(FILE);
@@ -55,17 +55,23 @@ 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;'`;
-
- if ( $ipmatch eq '' ){
+ my $established= `echo "$status" | grep '$settings[2]' | grep 'erouted;'`;
+ 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 ( ($round = 0) && ($established eq '')) {
+
+ if ($debug){logger("Round=".$round." and established=".$established);}
+
+ if ( ($round == 0) && ($established eq '')) {
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
| |