###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2017-2018 Stephan Feddersen <sfeddersen@ipfire.org> #
+# Copyright (C) 2017-2020 Stephan Feddersen <sfeddersen@ipfire.org> #
# All Rights Reserved. #
# #
# This program is free software: you can redistribute it and/or modify #
# #
###############################################################################
#
-# Version: 2019/06/04 21:12:23
+# Version: 2020/06/01 13:29:23
#
-# This wio.pl is based on the Code from the IPCop WIO Addon
+# This wio.pl is based on the code from the IPCop WIO Addon
# and is extremly adapted to work with IPFire.
#
# Autor: Stephan Feddersen
# Co-Autor: Alexander Marx
-# Co-Autor: Frank Mainz
+# Co-Autor: Frank Mainz (for some code for the IPCop WIO Addon)
#
# enable only the following on debugging purpose
require '/usr/lib/wio/wio-lib.pl';
my ( $debug, $i, $t, $ib, $tb, $ivpn, $tvpn ) = '';
-my $logdir = "/var/log/wio";
my $owner = getpwnam "nobody";
my $group = getgrnam "nobody";
-my $ipadrfile = "$logdir/wioips";
+my $ipadrfile = "/var/log/wio/wioips";
unless ( -e $ipadrfile ) { print ( "The file $ipadrfile doesn't exist!\n" ); exit; }
my $mailstyle = $wiosettings{'MAILSTYLE'};
my $mailremark = $wiosettings{'MAILREMARK'};
my $timeout = $wiosettings{'TIMEOUT'};
-my $shutdown = $wiosettings{'SHUTDOWN'};
my $rrddir = "/var/log/rrd/wio";
-my $onoffip = "$logdir/wioscip";
+my $onoffip = "/var/log/wio/wioscip";
my $hostname = "$mainsettings{'HOSTNAME'}.$mainsettings{'DOMAINNAME'}";
my $redactive = "/var/ipfire/red/active";
my $rediface = "/var/ipfire/red/iface";
my $t_ping = 'tcp';
my $nr = 1;
-my $poweroff = 0;
my ( $togglestat, $arp, $time, $start, $timestamp ) = 0;
my ( $id, $ipadr, $ipadrnew, $host, $hostnew, $enable, $remark, $dyndns, $dyndnsip ) = '';
my ( @tmp, @arptmp, @myarray, @status, @arpclients ) = '';
my @ifaces = ('GREEN','BLUE','ORANGE');
+if ( $netsettings{'RED_TYPE'} eq 'STATIC' || $netsettings{'RED_TYPE'} eq 'DHCP' ) {
+ push (@ifaces, "RED");
+}
+
if ( $mailsettings{'USEMAIL'} eq 'on' ) { $mailen = 'on'; }
else { $mailen = 'off'; }
}
}
-# write adressfile new
+# write ipadressfile new
if ( !-e $onoffip ) {
open( FILE, "> $ipadrfile" );
if ( $smailtxt ne '' ) { &WIO::mailsender($Lang::tr{'wio_sub'}, $smailtxt); }
-if ($shutdown eq 'on' && ! -e $onoffip) {
- foreach (@status) {
- chomp;
- @tmp = split( /\,/, $_ );
-
- ($id,$timestamp,$ipadr,$host,$enable,$remark,$dyndns,$mailon,$mailoff,$ping,$on,$httphost) = @tmp;
-
- if ( $on eq 'on' ) {
- $poweroff = 0;
- last;
- }
- else {
- $poweroff = 1;
- next;
- }
- }
-
- if ($poweroff == 1) {
- if ($debug) {
- printf "$Lang::tr{'shutting down ipfire'}!\n\n";
- }
-
- &General::log("wio","$Lang::tr{'shutting down ipfire'}!");
- system '/usr/local/bin/ipfirereboot down';
- }
-}
-
undef (@tmp);
undef (@myarray);
undef (@status);
}
sub startdebug {
-
printf "
HOSTNAME : $hostname
TIMEOUT : $timeout $Lang::tr{'age ssecond'}
RED TYPE : $netsettings{'RED_TYPE'}
RED DEVICE : $reddev
RED ADDRESS : $redip
-SHUTDOWN : $shutdown
";
- if ($ovpnpid) {printf "OVPN PID : $ovpnpid"}
- if ($vpnpid) {printf "VPN PID : $vpnpid"}
+
+if ($ovpnpid) {printf "OpenVPN PID : $ovpnpid"}
+if ($vpnpid) {printf "IPsec PID : $vpnpid"}
+
printf "
$Lang::tr{'wio_search'}