From 7dfcaef067115be24633f300ef76461ebc2b29c1 Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Tue, 14 Apr 2015 11:53:28 +0200 Subject: [PATCH] vpn-statistic: add collectd parameters to imported n2n packages --- html/cgi-bin/ovpnmain.cgi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 7ca62de31d..ece528add5 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -3197,7 +3197,6 @@ END @firen2nconf = ; close (FILE); chomp(@firen2nconf); - } else { $errormessage = "Filecount does not match only 2 files are allowed\n"; @@ -3238,6 +3237,13 @@ END unless(-d "${General::swroot}/ovpn/n2nconf/"){mkdir "${General::swroot}/ovpn/n2nconf", 0755 or die "Unable to create dir $!";} unless(-d "${General::swroot}/ovpn/n2nconf/$n2nname[0]"){mkdir "${General::swroot}/ovpn/n2nconf/$n2nname[0]", 0770 or die "Unable to create dir $!";} + #Add collectd settings to configfile + open(FILE, ">> $tempdir/$uplconffilename") or die 'Unable to open config file.'; + print FILE "# Logfile\n"; + print FILE "status-version 1\n"; + print FILE "status /var/run/openvpn/$n2nname[0]-n2n 10\n"; + close FILE; + move("$tempdir/$uplconffilename", "${General::swroot}/ovpn/n2nconf/$n2nname[0]/$uplconffilename2"); if ($? ne 0) { -- 2.39.2