[PATCH 3/6] Only mkdir /etc/perlbal once

Nick Andrew nick at nick-andrew.net
Mon Jun 23 07:56:54 UTC 2008


Only mkdir /etc/perlbal once

The supplied perlbal.postinst script possibly does mkdir /etc/perlbal
twice; only once is required.

Signed-off-by: Nick Andrew <nick at nick-andrew.net>
---

 debian/perlbal.postinst |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/debian/perlbal.postinst b/debian/perlbal.postinst
index 9d35fe4..a1284ab 100644
--- a/debian/perlbal.postinst
+++ b/debian/perlbal.postinst
@@ -1,8 +1,12 @@
 #!/bin/sh
 
-if [ ! -e /etc/perlbal/perlbal.conf ]
+if [ ! -d /etc/perlbal ]
 	then
 		mkdir -p /etc/perlbal
+fi
+
+if [ ! -e /etc/perlbal/perlbal.conf ]
+	then
 		echo No /etc/perlbal/perlbal.conf, copying sample file
 		cp /usr/share/doc/perlbal/examples/perlbal.conf /etc/perlbal/perlbal.conf
 		echo Be sure to edit /etc/perlbal/perlbal.conf
@@ -10,7 +14,6 @@ fi
 
 if [ ! -e /etc/perlbal/nodelist.dat ]
 	then
-		mkdir -p /etc/perlbal
 		echo No /etc/perlbal/nodelist.dat copying sample file
 		cp /usr/share/doc/perlbal/examples/nodelist.dat /etc/perlbal/nodelist.dat
 		echo Be sure to edit /etc/perlbal/nodelist.dat



More information about the perlbal mailing list