xdp-geoip: safe call to xdpgeoip init script

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
Vincent Li
2024-10-13 20:45:24 +00:00
parent 9c28bd419d
commit 8d6014683f
4 changed files with 49 additions and 1 deletions

View File

@@ -85,6 +85,13 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'}) {
}
&General::writehash("$settingsfile", \%settings);
# Check if we want to disable locationblock.
if ( $settings{'LOCATIONBLOCK_ENABLED'} eq "on" ) {
&General::system('/usr/local/bin/xdpgeoipctrl', 'start');
} else {
&General::system('/usr/local/bin/xdpgeoipctrl', 'stop');
}
}
&Header::openpage($Lang::tr{'locationblock configuration'}, 1, '');