File: open-isns-discoveryd.config

package info (click to toggle)
open-isns 0.101-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,420 kB
  • sloc: ansic: 19,981; sh: 3,211; python: 1,083; perl: 839; makefile: 214
file content (48 lines) | stat: -rw-r--r-- 1,633 bytes parent folder | download | duplicates (6)
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
42
43
44
45
46
47
48
#!/bin/sh
# config script for open-isns-discoveryd

. /usr/share/debconf/confmodule

set -e

manual_edit=0
if [ -f /etc/isns/isnsdd.conf ] ; then
    # Detect if a ServerAddress setting is present, because if we are
    # run as configure only, not reconfigure, we don't want to override
    # settings the user changed manually in the configuration file.
    orig_server="$(grep -E '^[[:space:]]*ServerAddress[[:space:]]*=' /etc/isns/isnsdd.conf | cut -d= -f2- | cut -d# -f1 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
    RET=""
    db_get open-isns-discoveryd/isns-server || true
    if [ -n "$RET" ] && [ -n "$orig_server" ] && [ x"$RET" != x"$orig_server" ] ; then
        manual_edit=1
    fi
fi

db_input high open-isns-discoveryd/isns-server || true
if ! [ -f /etc/isns/server_key.pub ] ; then
    db_input high open-isns-discoveryd/server-pubkey || true
fi
if ! [ -f /etc/isns/auth_key ] ; then
    db_input high open-isns-discoveryd/own-key       || true
fi
db_go || true

RET=""
db_get open-isns-discoveryd/isns-server || true
if [ -z "$RET" ] && [ $manual_edit -eq 0 ] ; then
    # No server name specified, so show a message that the daemon
    # won't be started in postinst.
    db_set open-isns-discoveryd/isns-server-override false
    db_input high open-isns-discoveryd/no-start || true
    db_go || true
else
    # Determine if we want to update the server address in the
    # configuration file
    if [ $1 = "reconfigure" ] || [ $manual_edit -eq 0 ] ; then
        db_set open-isns-discoveryd/isns-server-override true
    else
        db_set open-isns-discoveryd/isns-server-override false
    fi
fi

exit 0