1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/bin/sh
set -e
. /usr/share/debconf/confmodule
if [ "$1" = configure ]; then
db_get xringd/modem-device
if [ ! -f /etc/xringd.conf -a "echo "$RET" | grep -Eq '(tty|modem)'" ]; then
cat /usr/share/xringd/xringd.conf | sed "s&/dev/ttyS0&$RET&" > /etc/xringd.conf
else
MODDEV=$(grep -E '^-m ' /etc/xringd.conf | cut -d\ -f2)
if [ "$RET" != "$MODDEV" -a "echo "$RET" | grep -Eq '(tty|modem)'" ]; then
TMPFILE=$(mktemp /tmp/$p.XXXXXX)
cat /etc/xringd.conf | \
sed "s@^-m.*$MODDEV@-m $RET@" > $TMPFILE
mv /etc/xringd.conf /etc/xringd.conf.bak
mv $TMPFILE /etc/xringd.conf
fi
fi
fi
#DEBHELPER#
|