]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/wio/wio-lib.pl
WIO - shutdown function removed, adjustments to IPsec status display
[ipfire-2.x.git] / src / wio / wio-lib.pl
index 1ff7cfacc7f389b8b53b5ac7c9492265146c3146..eb7b33e7d4c5e6f6b396539d4c99dc89fd810340 100644 (file)
 #                                                                             #
 ###############################################################################
 #
-# Version: 2020/26/04 19:35:23
+# Version: 2020/05/25 19:39:23
 #
-# This wio-lib.pl is based on the Code from the IPCop WIO Addon
+# This wio-lib.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)
 #
 
 package WIO;
@@ -45,10 +45,9 @@ require '/var/ipfire/general-functions.pl';
 require '/var/ipfire/header.pl';
 require '/var/ipfire/lang.pl';
 
-my $mailfile = "${General::swroot}/dma/mail.conf";
-my %mail = ();
+my %mailsettings = ();
 
-&General::readhash($mailfile, \%mail);
+&General::readhash('/var/ipfire/dma/mail.conf', \%mailsettings);
 
 ############################################################################################################################
 
@@ -91,6 +90,14 @@ sub contime {
                if ( $temp[1] eq 'minutes' ) {
                        $totalsecs = $temp[0] * 60;
                }
+
+               if ( $temp[1] eq 'hours' ) {
+                       $totalsecs = $temp[0] * 3600;
+               }
+
+               if ( $temp[1] eq 'days' ) {
+                       $totalsecs = $temp[0] * 86400;
+               }
        }
 
        if ( $vpn eq 'ovpn' ) {
@@ -147,8 +154,8 @@ sub mailsender {
        my $msg = '';
 
        $msg = MIME::Lite->new(
-               From    => $mail{'SENDER'},
-               To              => $mail{'RECIPIENT'},
+               From    => $mailsettings{'SENDER'},
+               To              => $mailsettings{'RECIPIENT'},
                Subject => $_[0],
                Type    => 'multipart/mixed'
        );