From patchwork Sun Jun 28 10:44:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Feddersen X-Patchwork-Id: 3226 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 49vnLR4NjJz3x5V for ; Sun, 28 Jun 2020 10:44:31 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 49vnLQ4sv3z1fR; Sun, 28 Jun 2020 10:44:30 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 49vnLQ2BbHz2ySq; Sun, 28 Jun 2020 10:44:30 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 49vnLN1xhbz2y3N for ; Sun, 28 Jun 2020 10:44:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 49vnLM39tLz1Vl; Sun, 28 Jun 2020 10:44:27 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1593341067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=dJWGvvNr+vv7jIRVGb/r2YamC5j/Vev91FwM+UVOLBk=; b=EiknXMAmtp3mEkXxitIvCwLLw0qVJdpu0MdgcFjFTL9S41CGWCw3Z3TyAlanNg4Lbt50Qf 9bra40vV04hxTyCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1593341067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=dJWGvvNr+vv7jIRVGb/r2YamC5j/Vev91FwM+UVOLBk=; b=oyUfcjFAGhgU6wl4ek+Ztl7Ty1MjE3pLQMf8Dvj/+F/stjD/K3D8On9lRJIa7wCs0mGfmR Wr4E+9Lm/dGWsgw0ojhqirBlYPNDuhJMLUx2+xyngDxG4g85gBT4D+6kznIXDPTrqyqBeN N/mPyCHlTtRf+y49j4CVYAyoR6m0PBiOVVF0rOO+5+9uzTsjjy1fyuUTHjyEiOw49GY1ez WXGSEUR+v64hoFqHfnZS1ZPkEpUjC44emsj0dlbVkq0wzVQZAgqY4SFhvmYrpGuQxiDPqp Bm2HnBlChUo41+wP5+2oVYhnyFyfYBfOmmu3hSwd03e+qXQ/WPIGYy6AzEYV5Q== From: Stephan Feddersen To: development@lists.ipfire.org Subject: [PATCH] WIO - shutdown function removed, adjustments to IPsec status display Date: Sun, 28 Jun 2020 12:44:18 +0200 Message-Id: <20200628104418.28598-1-sfeddersen@ipfire.org> Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=sfeddersen@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephan Feddersen Errors-To: development-bounces@lists.ipfire.org Sender: "Development" --- src/wio/main/wio.pl | 56 ++++++++++++--------------------------------- 1 file changed, 15 insertions(+), 41 deletions(-) diff --git a/src/wio/main/wio.pl b/src/wio/main/wio.pl index 8e2fb8879..91c6c1494 100644 --- a/src/wio/main/wio.pl +++ b/src/wio/main/wio.pl @@ -3,7 +3,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2017-2018 Stephan Feddersen # +# Copyright (C) 2017-2020 Stephan Feddersen # # All Rights Reserved. # # # # This program is free software: you can redistribute it and/or modify # @@ -21,14 +21,14 @@ # # ############################################################################### # -# 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 @@ -46,10 +46,9 @@ require '/var/ipfire/lang.pl'; 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; } @@ -70,9 +69,8 @@ my $logging = $wiosettings{'LOGGING'}; 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"; @@ -91,7 +89,6 @@ my $i_ping = 'icmp'; 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 ) = ''; @@ -101,6 +98,10 @@ my ( $ping_i, $ping_t, $ping_ib, $ping_tb, $ping_iv, $ping_tv, $pingmode ) = ''; 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'; } @@ -279,7 +280,7 @@ foreach (@myarray) { } } -# write adressfile new +# write ipadressfile new if ( !-e $onoffip ) { open( FILE, "> $ipadrfile" ); @@ -298,33 +299,6 @@ if ($debug) { 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); @@ -355,7 +329,6 @@ sub updatewiodata { } sub startdebug { - printf " HOSTNAME : $hostname TIMEOUT : $timeout $Lang::tr{'age ssecond'} @@ -363,10 +336,11 @@ MAILSTYLE : $mailstyle 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'}