mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-12 12:15:52 +02:00
core89: Update OpenVPN configuration during the update
This commit is contained in:
committed by
Michael Tremer
parent
82e454712b
commit
831a5ef6ad
@@ -124,6 +124,7 @@ usr/local/bin/update-lang-cache
|
||||
#usr/local/src
|
||||
#usr/sbin
|
||||
usr/sbin/ovpn-ccd-convert
|
||||
usr/sbin/ovpn-collectd-convert
|
||||
#usr/share
|
||||
#usr/share/doc
|
||||
#usr/share/doc/licenses
|
||||
|
||||
@@ -13,6 +13,7 @@ srv/web/ipfire/cgi-bin/ovpnmain.cgi
|
||||
srv/web/ipfire/cgi-bin/vpnmain.cgi
|
||||
usr/local/bin/collectdctrl
|
||||
usr/local/bin/openvpnctrl
|
||||
usr/sbin/ovpn-collectd-convert
|
||||
usr/sbin/setup
|
||||
var/ipfire/backup/bin/backup.pl
|
||||
var/ipfire/graphs.pl
|
||||
|
||||
@@ -66,6 +66,9 @@ rm -f \
|
||||
/opt/pakfire/db/*/meta-sqlite \
|
||||
/opt/pakfire/db/rootfiles/sqlite
|
||||
|
||||
# Update OpenVPN/collectd configuration
|
||||
/usr/sbin/ovpn-collectd-convert
|
||||
|
||||
# Fix #10625
|
||||
mkdir -p /etc/logrotate.d
|
||||
|
||||
|
||||
26
src/scripts/ovpn-collectd-convert
Normal file
26
src/scripts/ovpn-collectd-convert
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/perl
|
||||
# Converter script for adding existing OpenVPN N2N connections to collectd
|
||||
# Used for core update 89
|
||||
|
||||
my %ovpnconfig=();
|
||||
|
||||
require '/var/ipfire/general-functions.pl';
|
||||
|
||||
open(COLLECTDVPN, ">${General::swroot}/ovpn/collectd.vpn") or die "Unable to open collectd.vpn: $!";
|
||||
print COLLECTDVPN "Loadplugin openvpn\n";
|
||||
print COLLECTDVPN "\n";
|
||||
print COLLECTDVPN "<Plugin openvpn>\n";
|
||||
print COLLECTDVPN "Statusfile \"/var/run/ovpnserver.log\"\n";
|
||||
|
||||
&General::readhasharray("/var/ipfire/ovpn/ovpnconfig", \%ovpnconfig);
|
||||
foreach my $key (keys %ovpnconfig) {
|
||||
if ($ovpnconfig{$key}[0] eq 'on' && $ovpnconfig{$key}[3] eq 'net') {
|
||||
print COLLECTDVPN "Statusfile \"/var/run/openvpn/$ovpnconfig{$key}[1]-n2n\"\n";
|
||||
}
|
||||
}
|
||||
|
||||
print COLLECTDVPN "</Plugin>\n";
|
||||
close(COLLECTDVPN);
|
||||
|
||||
# Reload collectd afterwards
|
||||
system("/usr/local/bin/collectdctrl restart &>/dev/null");
|
||||
Reference in New Issue
Block a user