public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, master, updated. 42dbdb2088b7877ad1626d19db47089e07996b37
Date: Thu, 09 Jan 2014 13:30:42 +0100	[thread overview]
Message-ID: <20140109123043.7030320C2D@argus.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 2589 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, master has been updated
       via  42dbdb2088b7877ad1626d19db47089e07996b37 (commit)
      from  59cbe38697db109f4860e1117b8307b588957b6c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 42dbdb2088b7877ad1626d19db47089e07996b37
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Thu Jan 9 12:43:39 2014 +0100

    OpenVPN converter: Fix coding style and verbose output.

-----------------------------------------------------------------------

Summary of changes:
 src/scripts/convert-ovpn | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

Difference in files:
diff --git a/src/scripts/convert-ovpn b/src/scripts/convert-ovpn
index 1e99bce..58921a5 100755
--- a/src/scripts/convert-ovpn
+++ b/src/scripts/convert-ovpn
@@ -27,25 +27,34 @@
 #                                                                             #
 ###############################################################################
 
+require '/var/ipfire/general-functions.pl';
+
 my %configovpn=();
 my $ccdpath="/var/ipfire/ovpn/ccd/";
 my $ovpnconfig="/var/ipfire/ovpn/ovpnconfig";
-require '/var/ipfire/general-functions.pl';
 
 &General::readhasharray ($ovpnconfig,\%configovpn);
 
-&check_config;
+&check_config();
 
+sub check_config {
+	print "Converting CCD files...\n";
+	chdir($ccdpath);
 
-sub check_config
-{
-	print "\n";
 	foreach my $key (sort keys %configovpn){
-		if ($configovpn{$key}[3] eq 'host' && $configovpn{$key}[2]=~" "){
-			my $ccdname=$configovpn{$key}[2];
-			$ccdname =~ tr/ /_/;
-			chdir($ccdpath);
-			rename($ccdname,$configovpn{$key}[2]);
+		# Skip everything else but roadwarrior connections.
+		next if ($configovpn{$key}[3] ne 'host');
+
+		# Skip all connections with no space in the CN name.
+		next if ($configovpn{$key}[2] !~ " ");
+
+		my $ccdname = $configovpn{$key}[2];
+		$ccdname =~ tr/ /_/;
+
+		# Rename the CCD file if one with the old format exists.
+		if (-e "$ccdname") {
+			print " Renaming $ccdname -> $configovpn{$key}[2]...\n";
+			rename($ccdname, $configovpn{$key}[2]);
 		}
 	}
 }


hooks/post-receive
--
IPFire 2.x development tree

                 reply	other threads:[~2014-01-09 12:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140109123043.7030320C2D@argus.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox