vpn-statistic: update old n2n configs in update.sh
authorAlexander Marx <alexander.marx@ipfire.org>
Mon, 13 Apr 2015 13:03:17 +0000 (15:03 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 13 Apr 2015 13:46:45 +0000 (15:46 +0200)
config/rootfiles/core/89/update.sh

index bb6c7a5..90a6d77 100644 (file)
@@ -75,6 +75,18 @@ chown nobody.nobody \
        /var/run/ovpnserver.log
 
 # Update OpenVPN/collectd configuration
+files=`find /var/ipfire/ovpn/n2nconf/ -type d`
+for i in $files;
+do
+       if ! grep -q "status-version" $i/${i##*/}.conf; then
+               echo "# Logfile" >> $i/${i##*/}.conf
+               echo "status-version 1" >> $i/${i##*/}.conf
+       fi
+       if ! grep -q "status " $i/${i##*/}.conf; then
+               echo "status /var/run/openvpn/${i##*/}-n2n 10" >> $i/${i##*/}.conf
+       fi
+done
+
 /usr/sbin/ovpn-collectd-convert
 chown nobody.nobody /var/ipfire/ovpn/collectd.vpn