&General::writehash("/var/ipfire/wireguard/settings", \%Wireguard::settings);
# Start if enabled
- if ($Wireguard::settings{'ENABLED'} eq "on") {
+ if (&Wireguard::is_enabled()) {
&General::system("/usr/local/bin/wireguardctrl", "start");
} else {
&General::system("/usr/local/bin/wireguardctrl", "stop");
&General::writehasharray("/var/ipfire/wireguard/peers", \%Wireguard::peers);
# Reload if enabled
- if ($Wireguard::settings{'ENABLED'} eq "on") {
+ if (&Wireguard::is_enabled()) {
&General::system("/usr/local/bin/wireguardctrl", "start");
}
&General::writehasharray("/var/ipfire/wireguard/peers", \%Wireguard::peers);
# Reload if enabled
- if ($Wireguard::settings{'ENABLED'} eq "on") {
+ if (&Wireguard::is_enabled()) {
&General::system("/usr/local/bin/wireguardctrl", "start");
}
&General::writehasharray("/var/ipfire/wireguard/peers", \%Wireguard::peers);
# Reload if enabled
- if ($Wireguard::settings{'ENABLED'} eq "on") {
+ if (&Wireguard::is_enabled()) {
&General::system("/usr/local/bin/wireguardctrl", "start");
}
&General::writehasharray("/var/ipfire/wireguard/peers", \%Wireguard::peers);
# Reload if enabled
- if ($Wireguard::settings{'ENABLED'} eq "on") {
+ if (&Wireguard::is_enabled()) {
&General::system("/usr/local/bin/wireguardctrl", "start");
}
&General::writehasharray("/var/ipfire/wireguard/peers", \%Wireguard::peers);
# Reload if enabled
- if ($Wireguard::settings{'ENABLED'} eq "on") {
+ if (&Wireguard::is_enabled()) {
&General::system("/usr/local/bin/wireguardctrl", "start");
}
&General::writehasharray("/var/ipfire/wireguard/peers", \%Wireguard::peers);
# Reload if enabled
- if ($Wireguard::settings{'ENABLED'} eq "on") {
+ if (&Wireguard::is_enabled()) {
&General::system("/usr/local/bin/wireguardctrl", "start");
}
}
&Header::openbox('100%', '', $Lang::tr{'global settings'});
my %checked = (
- "ENABLED" => ($Wireguard::settings{'ENABLED'} eq "on") ? "checked" : "",
+ "ENABLED" => (&Wireguard::is_enabled()) ? "checked" : "",
);
my %readonly = (