diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2006-12-18 22:54:21 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2006-12-18 22:54:21 +0100 |
commit | eb0fd9a62e00a488ded184eafc0518c23870fa13 (patch) | |
tree | e241b260b75c8d1fa76a4a3dbeea65e18b88083a /debian | |
parent | e642cf83e1a201d001284ee8820455492578c371 (diff) |
handle cases where commands in backticks return an error code
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@175 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'debian')
-rw-r--r-- | debian/libnss-ldapd.config | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/debian/libnss-ldapd.config b/debian/libnss-ldapd.config index 7073b3c..6e86bb8 100644 --- a/debian/libnss-ldapd.config +++ b/debian/libnss-ldapd.config @@ -22,23 +22,23 @@ db_title "Configuring libnss-ldapd" parsesys() { # guess domain based on system information - domain=`hostname --domain` - [ -z "$domain" ] && domain=`hostname --nis | grep '\.'` - [ -z "$domain" ] && domain=`hostname --fqdn | sed -n 's/^[^.]*\.//p'` - [ -z "$domain" ] && domain=`sed -n 's/^ *\(domain\|search\) *\([^ ]*\) *$/\2/p' /etc/resolv.conf | head -n 1` + 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/^ *\(domain\|search\) *\([^ ]*\) *$/\2/p' /etc/resolv.conf | head -n 1` || true if [ -n "$domain" ] then # set search base - searchbase=`echo "$domain" | sed 's/^/dc=/;s/\./,dc=/'` + searchbase=`echo "$domain" | sed 's/^/dc=/;s/\./,dc=/'` || true db_set libnss-ldapd/ldap-base "$searchbase" fi # guess ldap server - server=`getent hosts ldap` - [ -z "$server" ] && server=`getent hosts dirhost` + server=`getent hosts ldap` || true + [ -z "$server" ] && server=`getent hosts dirhost` || true if [ -n "$domain" ] && [ -z "$server" ] then - server=`getent hosts ldap."$domain"` - [ -z "$server" ] && server=`getent hosts dirhost."$domain"` + server=`getent hosts ldap."$domain"` || true + [ -z "$server" ] && server=`getent hosts dirhost."$domain"` || true fi if [ -n "$server" ] then @@ -62,11 +62,11 @@ parsecfg() port=`sed -n 's/^port[[:space:]]*//ip' "$cfgfile"` for host in $hosts do - if [ -n "$port" ] && [ -z `echo $host | grep ':'` ] + if [ -z "$port" ] || (echo "$host" | grep -q ':' ) then - uris="$uris ldap://$host:$port/" - else uris="$uris ldap://$host/" + else + uris="$uris ldap://$host:$port/" fi done fi |