require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
+require "${General::swroot}/wireguard-functions.pl";
require "/opt/pakfire/lib/functions.pl";
my %cgiparams=();
my %ddnssettings=();
my %proxysettings=();
my %vpnsettings=();
-my %wgsettings=();
my %vpnconfig=();
my %ovpnconfig=();
my $warnmessage = '';
&General::readhash("${General::swroot}/ddns/settings", \%ddnssettings);
&General::readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings);
&General::readhash("${General::swroot}/vpn/settings", \%vpnsettings);
-&General::readhash("${General::swroot}/wireguard/settings", \%wgsettings);
my %color = ();
my %mainsettings = ();
END
}
-#check if WireGuard is running
-if ( $wgsettings{'ENABLED'} eq 'on' ) {
-print<<END;
+# Show WireGuard status
+if (&Wireguard::is_enabled()) {
+ print<<END;
<tr>
<td style='width:25%; text-align:center; background-color:$Header::colourwg;'>
<a href='/cgi-bin/wireguard.cgi' style='color:white'><b>$Lang::tr{'wg'}</b></a>