core89: Fix script that updates OpenVPN configuration files

This commit is contained in:
Michael Tremer
2015-04-17 18:20:40 +02:00
parent c023275154
commit 3a2e08b29d

View File

@@ -75,15 +75,15 @@ 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
# Update OpenVPN/collectd configuration
for i in /var/ipfire/ovpn/n2nconf/*/*.conf; do
if ! grep -qE "^status-version" ${i}; then
echo "# Logfile" >> ${i}
echo "status-version 1" >> ${i}
fi
if ! grep -q "status " $i/${i##*/}.conf; then
echo "status /var/run/openvpn/${i##*/}-n2n 10" >> $i/${i##*/}.conf
if ! grep -qE "^status " ${i}; then
echo "status /var/run/openvpn/${i##*/}-n2n 10" >> ${i}
fi
done