summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2011-12-10 21:09:53 +0000
committerArthur de Jong <arthur@arthurdejong.org>2011-12-10 21:09:53 +0000
commit258681b99162321fdca0fa2565f687ad2312858d (patch)
treea17247ddaa6900534e6a2826fbb245da233592bd
parentcc3abbbfbfde67905f426e25099e6fea6d7aa4f8 (diff)
get the first configuration value instead of the last because that one is also written
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1567 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--debian/nslcd.config10
1 files changed, 5 insertions, 5 deletions
diff --git a/debian/nslcd.config b/debian/nslcd.config
index 39f84db..4ac7118 100644
--- a/debian/nslcd.config
+++ b/debian/nslcd.config
@@ -21,7 +21,7 @@ db_capb backup
#
# read a configuration value from the specified file
-# (it takes care in not overwriting a previously written value)
+# (it takes care in not overwriting a previously written debconf value)
read_config()
{
debconf_param="$1"
@@ -29,7 +29,7 @@ read_config()
# overwrite debconf value if different from config file
db_get "$debconf_param"
debconf_value="$RET"
- cfgfile_value=`sed -n 's/^'"$cfg_param"'[[:space:]]*\([^[:space:]].*[^[:space:]]\)[[:space:]]*$/\1/ip' "$cfgfile" | tail -n 1`
+ cfgfile_value=`sed -n 's/^'"$cfg_param"'[[:space:]]*\([^[:space:]].*[^[:space:]]\)[[:space:]]*$/\1/ip' "$cfgfile" | head -n 1`
[ -n "$cfgfile_value" ] && [ "$debconf_value" != "$cfgfile_value" ] && db_set "$debconf_param" "$cfgfile_value"
# we're done
return 0
@@ -41,7 +41,7 @@ get_domain()
domain=`hostname --domain` || true
[ -z "$domain" ] && domain=`hostname --nis | grep '\.'` || true
[ -z "$domain" ] && domain=`hostname --fqdn | sed -n 's/^[^.]*\.//p'` || true
- [ -z "$domain" ] && domain=`sed -n 's/^[[:space:]]*\(domain\|search\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/p' /etc/resolv.conf | head -n 1` || true
+ [ -z "$domain" ] && domain=`sed -n 's/^[[:space:]]*\(domain\|search\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/p' /etc/resolv.conf | tail -n 1` || true
echo "$domain"
}
@@ -159,7 +159,7 @@ parsecfg()
if [ -z "$uris" ]
then
hosts=`sed -n 's/^host[[:space:]]*//ip' "$cfgfile"`
- port=`sed -n 's/^port[[:space:]]*//ip' "$cfgfile" | tail -n 1`
+ port=`sed -n 's/^port[[:space:]]*//ip' "$cfgfile" | head -n 1`
for host in $hosts
do
if [ -z "$port" ] || (echo "$host" | grep -q ':' )
@@ -198,7 +198,7 @@ parsecfg()
db_get nslcd/ldap-reqcert
if [ -z "$RET" ]
then
- reqcert=`sed -n 's/^tls_\(reqcert\|checkpeer\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/ip' "$cfgfile" | tail -n 1`
+ reqcert=`sed -n 's/^tls_\(reqcert\|checkpeer\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/ip' "$cfgfile" | head -n 1`
# normalise value
reqcert=`echo "$reqcert" | tr 'A-Z' 'a-z' | sed 's/^no$/never/;s/^yes$/demand/;s/^hard$/demand/'`
[ -n "$reqcert" ] && db_set nslcd/ldap-reqcert "$reqcert"