1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#! /bin/sh /usr/share/dpatch/dpatch-run
## 05_correct_bashisms_ldap2bind.dpatch by <benoit.mortier@opensides.be>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Correct Bashisms in ldap2bind
@DPATCH@
--- ldap2zone-0.1.orig/ldap2bind
+++ ldap2zone-0.1/ldap2bind
@@ -2,7 +2,11 @@
[ -r /etc/default/ldap2zone ] && . /etc/default/ldap2zone
-[[ ${LDAP_URI} =~ 'ldap''s'?'://''.'* ]] || LDAP_URI="ldap://${LDAP_URI}"
+case "$LDAP_URI" in
+ldap://*|ldaps://*) ;;
+ *) LDAP_URI="ldap://${LDAP_URI}" ;;
+ esac
+
LDAPSEARCH=`which ldapsearch`
LDAP_URI_PARAM=${LDAP_URI:+"-H $LDAP_URI"}
ALLOW_UPDATE_PARAM=${ALLOW_UPDATE:+"allow-update {$ALLOW_UPDATE};"}
@@ -53,6 +57,8 @@
result=$($rndc reload $domain 2>&1)
if [ $? -ne 0 ]; then
- echo -e "Reloading the zone '$domain' failed:\n$result" 1>&2
+ printf "Reloading the zone '$domain' failed: $result\n" 1>&2
+ else
+ printf "Reloading the zone '$domain' was successful\n" 1>&2
fi
done
|