File: config

package info (click to toggle)
gnarwl 3.6.dfsg-13
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 880 kB
  • sloc: ansic: 1,191; makefile: 119; sh: 70; php: 44
file content (41 lines) | stat: -rw-r--r-- 929 bytes parent folder | download | duplicates (5)
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
34
35
36
37
38
39
40
41
#!/bin/sh -e

# Source debconf library.
. /usr/share/debconf/confmodule

#DEBHELPER#

# Get LDAP-Server
db_metaget gnarwl/server || true
if [ -z "$RET" ]; then
  if [ -f /etc/ldap/ldap.conf ]; then
    URI=`cat /etc/ldap/ldap.conf | awk '/^URI/ {print $2}' | sed "s/ldap:\/\///gi"`
    if [ -z "$URI" ]; then
      HOST=`cat /etc/ldap/ldap.conf | awk '/^HOST/ {print $2}' | head -1`
      PORT=`cat /etc/ldap/ldap.conf | awk '/^PORT/ {print $2}' | head -1`
      URI="$HOST"
      [ "$PORT" ] && URI="$URI:$PORT"
    fi
    db_set gnarwl/server $URI
  fi
fi

# Get LDAP-Base
db_metaget gnarwl/base || true
if [ -z "$RET" ]; then
  if [ -f /etc/ldap/ldap.conf ]; then
    BASE=`cat /etc/ldap/ldap.conf | sed "s/^BASE[ 	]*//g" | grep "^BASE" | head -1`
  fi
  echo $BASE
  [ "$BASE" ] && db_set gnarwl/server $BASE
fi


db_input medium gnarwl/server || true
db_go

# Get LDAP-Base
db_input medium gnarwl/base || true
db_go

exit 0