config is in nbd-client 1:3.7-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | #!/bin/bash
# load the library
. /usr/share/debconf/confmodule
db_version 2.0
db_capb backup
# Load our configuration file, if it exists
[ -e /etc/nbd-client ] && . /etc/nbd-client
done=f
# check whether we need to continue
if [ "$AUTO_GEN"x = "nx" ]
then
done=t
db_input low nbd-client/no-auto-config
db_go
fi
# ask what we need to know.
while [ "$done" = "f" ]
do
i=0
while [ ! -z "${NBD_PORT[$i]}" ]
do
i=$(( $i + 1 ))
done
if [ $i -gt 0 ]
then
db_set nbd-client/number $i
fi
if [ "$KILLALL"=="false" ]
then
db_set nbd-client/killall false
fi
db_input medium nbd-client/number
db_input high nbd-client/killall
db_go
db_get nbd-client/number
NUMBER=${RET:-0}
if [ $NUMBER -gt 0 ]
then
db_beginblock
for i in $(seq 0 $(( $NUMBER - 1)) )
do
cur=$i
if [ $i -gt 0 ]
then
db_register nbd-client/type nbd-client/type$i
db_register nbd-client/host nbd-client/host$i
db_register nbd-client/port nbd-client/port$i
db_register nbd-client/device nbd-client/device$i
db_register nbd-client/extra nbd-client/extra$i
else
unset i
fi
db_subst nbd-client/type$i number $cur
db_subst nbd-client/host$i number $cur
db_subst nbd-client/port$i number $cur
db_subst nbd-client/device$i number $cur
db_subst nbd-client/extra$i number $cur
if [ ! -z "${NBD_DEVICE[$cur]}" ]
then
case "${NBD_TYPE[$cur]}" in
s)
db_set nbd-client/type$i swap
;;
f)
db_set nbd-client/type$i filesystem
;;
r)
db_set nbd-client/type$i raw
;;
esac
db_set nbd-client/host$i "${NBD_HOST[$cur]}"
if [ -z "${NBD_PORT[$cur]}" -a ! -z "${NBD_NAME[$cur]}" ]
then
NBD_PORT[$cur]="${NBD_NAME[$cur]}"
fi
db_set nbd-client/port$i "${NBD_PORT[$cur]}"
db_set nbd-client/device$i "${NBD_DEVICE[$cur]}"
db_set nbd-client/extra$i "${NBD_EXTRA[$cur]}"
fi
db_beginblock
db_input medium nbd-client/type$i
db_input medium nbd-client/host$i
db_input medium nbd-client/port$i
db_input medium nbd-client/device$i
db_input low nbd-client/extra$i
db_endblock
done
db_endblock
if db_go
then
done=t
else
for i in $(seq 1 $NUMBER)
do
db_unregister nbd-client/type$i || true
db_unregister nbd-client/host$i || true
db_unregister nbd-client/port$i || true
db_unregister nbd-client/device$i || true
db_unregister nbd-client/extra$i || true
done
fi
else
done=t
fi
done
|