config is in isdnvboxserver 1:3.25+dfsg1-3.3ubuntu2.
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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | #!/bin/sh
set -e
# Vars involved, and how they're used:
#
# msn number to listen to /etc/isdn/vboxgetty.conf
# daemonuser what ID for vboxgetty to run under /etc/isdn/vboxgetty.conf
# user user for network connection /etc/isdn/vboxd.conf
# password password for network connection /etc/isdn/vboxd.conf
# NOT YET:
# attachmsg attach message to email yes/no spool../standard.tcl
# rings number of rings to wait spool../vbox.conf
# or ~user/.vbox.conf
# defaults for msn, daemonuser are extracted from /etc/isdn/vboxgetty.conf
# spooldir is also extracted, to possibly normalize it.
# defaults for user, password are extracted from /etc/isdn/vboxd.conf
# Source debconf library.
. /usr/share/debconf/confmodule
confmode="$1"
prevvers="$2"
db_fset isdnvboxserver/dummy seen true
db_get isdnvboxserver/dummy || true
if [ "$confmode" != reconfigure -a "$RET" = doneonce ]; then db_stop; exit 0; fi # already been run
db_set isdnvboxserver/dummy doneonce
# See if config files already there. If so, extract defaults.
if [ -s /etc/isdn/vboxgetty.conf ]; then
# only use ttyI6
eval `perl -- - /etc/isdn/vboxgetty.conf <<'EOF'
while (<>) { last if m,^port /dev/ttyI6,; }
while (<>) { last if m,^port,;
if (/^\s+modeminit\s+.*&E\s*(\d+)/) { print "VBOX_MSN=$1\n"; }
if (/^\s+user\s+(\S+)/) { print "VBOX_DUSER=$1\n"; }
}
EOF
`
db_get isdnvboxserver/msn || true
if [ -z "$VBOX_MSN" ] || [ "$VBOX_MSN" = 000000 ]; then
# not filled in or still the default value
if [ -z "$RET" -o "$RET" = 000000 ]; then
# debconf also has the default value
db_fset isdnvboxserver/msn seen false
elif [ -z "$RET" -o `echo "$RET" | tr A-Z a-z` = quit ]; then
# the user has indicated a preference to do it by hand
# show them the question again to be sure
#NOT
#db_fset isdnvboxserver/msn seen false
:
fi
:
else
# vboxgetty.conf has a non-default value. Use that...
if [ -z "$RET" -o `echo "$RET" | tr A-Z a-z` = quit ]; then
# ... unless the user wants to do it by hand.
# In that case, don't use debconf at all.
if [ "$confmode" = reconfigure ]; then
# If reconfiguring, force the question to be seen again
db_fset isdnvboxserver/msn seen false
else
# Otherwise don't bother the user and basically stop
db_fset isdnvboxserver/msn seen true
db_go
db_stop
exit 0
fi
else
# use debconf, so set the files' value into debconf
# and force the question to be seen again
db_get isdnvboxserver/msn
if [ "$RET" != "$VBOX_MSN" ]; then
# only set it if different, of course
db_set isdnvboxserver/msn "$VBOX_MSN"
fi
# db_fset isdnvboxserver/msn seen false
fi
fi
#########################
db_get isdnvboxserver/daemonuser
if [ ! -z "$VBOX_DUSER" ] && [ "$VBOX_DUSER" != vboxdaemonuser ] && [ "$VBOX_DUSER" != dummyuser ]; then
# the file does not have any known default value
# set it into debconf
# and force the question to be seen again
if [ "$RET" != "$VBOX_DUSER" ]; then
# only set it if different, of course
db_set isdnvboxserver/daemonuser "$VBOX_DUSER"
db_fset isdnvboxserver/daemonuser seen false
fi
else
# the file has a default value
if [ -z "$RET" -o "$RET" = vboxdaemonuser -o "$RET" = dummyuser ]; then
# debconf has a default value, so force asking again
db_fset isdnvboxserver/daemonuser seen false
fi
fi
fi
# Lines in vboxd.conf: (i.e. not comments here!!!)
# # Remove this comment if you don't want any configuration to happen.
# A:localhost:RW:username:*invalid*password*:/var/spool/vbox/ttyI6:incoming
if [ -s /etc/isdn/vboxd.conf ]; then
eval `perl -- - /etc/isdn/vboxd.conf <<'EOF'
while (<>) { last if m,^# Remove this comment if you don.t want,; }
$backtick = chr(96);
while (<>) {
s/$backtick/\\\\$backtick/g;
s/([\"\\$])/\\\\$1/g;
next unless m,^A:[^:]+:[^:]+:([^:]+):([^:]+):([^:]+),;
print "VBOX_USER=\"$1\"\nVBOX_PASSWORD=\"$2\"\nVBOX_USERSPOOL=\"$3\"\n";
exit 0;
}
EOF
`
db_get isdnvboxserver/user || true
if [ ! -z "$VBOX_USER" ] && [ "$VBOX_USER" != username ]; then
# vboxd.conf contains a non-default value
if [ "$RET" != "$VBOX_USER" ]; then
# debconf contains a different value, update it
db_set isdnvboxserver/user "$VBOX_USER"
# and make the question be seen again
db_fset isdnvboxserver/user seen false
fi
else
# file has default value
if [ -z "$RET" -o "$RET" = username ]; then
# debconf also has default value, so
# debconf needs to ask this question
db_fset isdnvboxserver/user seen false
fi
fi
db_get isdnvboxserver/password || true
if [ ! -z "$VBOX_PASSWORD" ] && [ "$VBOX_PASSWORD" != '*invalid*password*' ]
then
# vboxd.conf contains a non-default value
if [ "$RET" != "$VBOX_PASSWORD" ]; then
# debconf contains a different value, update it
# The new one probably contains the crypted version
db_set isdnvboxserver/password "$VBOX_PASSWORD"
#NOT and make the question be seen again
#NOT db_fset isdnvboxserver/password seen false
fi
else
# file has default value
if [ -z "$RET" -o "$RET" = '*invalid*password*' ]; then
# debconf also has default value, so
# debconf needs to ask this question
db_fset isdnvboxserver/password seen false
fi
fi
fi
######################################################################
# End of processing existing values in config files
######################################################################
# Now ask the questions
STATUS=0
db_input critical isdnvboxserver/msn || STATUS=$?
if [ $STATUS -eq 30 ]; then
exit 0
fi
db_go || STATUS=$?
if [ $STATUS -eq 30 ]; then
exit 0
fi
db_get isdnvboxserver/msn || STATUS=$?
if [ -z "$RET" -o "`echo "$RET" | tr A-Z a-z`" = "quit" ]; then
exit 0
fi
asked=true
while $asked ; do
db_input critical isdnvboxserver/daemonuser || STATUS=$?
if [ $STATUS -eq 30 ]; then
asked=false # question not asked
fi
db_go || STATUS=$?
if [ $STATUS -eq 30 ]; then
exit 1 # cancel selected
fi
db_get isdnvboxserver/daemonuser || true
if getent passwd "$RET" >/dev/null; then
# user exists, does his homedir?
VBOX_USERHOME=`getent passwd "$RET" | cut -f6 -d:`
if [ -z "$VBOX_USERHOME" -o ! -d "$VBOX_USERHOME" ]; then
db_subst isdnvboxserver/vboxnodir DIR $VBOX_USERHOME
db_subst isdnvboxserver/vboxnodir USER "$RET"
db_fset isdnvboxserver/vboxnodir seen false
db_input high isdnvboxserver/vboxnodir || true
db_go
db_fset isdnvboxserver/daemonuser seen false
continue
fi
break
fi
db_subst isdnvboxserver/nosuchuser Daemonuser "$RET"
db_fset isdnvboxserver/nosuchuser seen false
db_input critical isdnvboxserver/nosuchuser
db_fset isdnvboxserver/daemonuser seen false
if $asked; then
:
else
exit 1 # fatal if use doesn't exist and no chance to enter it
fi
done
# db_input medium isdnvboxserver/rings
# db_input medium isdnvboxserver/attachmsg
if db_input high isdnvboxserver/user ; then
db_go || STATUS=$?
if [ $STATUS -eq 30 ]; then
exit 0 # cancel selected
fi
fi
db_get isdnvboxserver/user
VBOX_USER=$RET
if [ ! -z "$VBOX_USER" ]; then # don't ask password if no user entered
db_subst isdnvboxserver/password User $VBOX_USER
db_input high isdnvboxserver/password
db_go || STATUS=$?
if [ $STATUS -eq 30 ]; then
exit 0 # cancel selected
fi
fi
#db_get isdnvboxserver/rings
#VBOX_RINGS=$RET
#db_get isdnvboxserver/attachmsg
#VBOX_ATTACH=$RET
if egrep -q 'vboxgetty' /etc/inittab; then
: # already in inittab
else
db_input high isdnvboxserver/doinit
db_go || STATUS=$?
if [ $STATUS -eq 30 ]; then
exit 0 # cancel selected
fi
fi
db_stop
exit 0
|