WvDial changes for 1.56.
git-svn-id: file:///home/apenwarr/alumnit-svn/public/releases/freesw@11027 6619c942-59fa-0310-bf43-a07aaa81d9ac
This commit is contained in:
parent
9ce53bea07
commit
0b63524e42
|
@ -1,3 +1,11 @@
|
|||
wvdial (1.56-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
- wvdialconf actually writes settings. (Closes: Bug#350882)
|
||||
* Reduce the priority of debconf questions. (Closes: Bug#348621)
|
||||
|
||||
-- Simon Law <sfllaw@debian.org> Wed, 22 Feb 2006 13:20:56 -0500
|
||||
|
||||
wvdial (1.55-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
|
|
@ -7,30 +7,52 @@ set -e
|
|||
|
||||
db_capb backup
|
||||
|
||||
# Update the Debconf database with information from /etc/wvdial.conf
|
||||
if [ -e /etc/wvdial.conf ] && type uni >/dev/null 2>/dev/null; then
|
||||
export UNICONF='ini:/etc/wvdial.conf'
|
||||
update_db()
|
||||
{
|
||||
RET=`uni get "$1"`
|
||||
if [ $? ]; then
|
||||
db_set "$2" "$RET"
|
||||
fi
|
||||
}
|
||||
else
|
||||
# We can't do anything
|
||||
update_db()
|
||||
{
|
||||
true
|
||||
}
|
||||
fi
|
||||
|
||||
STATE=1
|
||||
LASTSTATE=5
|
||||
while [ "$STATE" != 0 ] && [ "$STATE" -le "$LASTSTATE" ]; do
|
||||
case "$STATE" in
|
||||
1)
|
||||
db_input medium wvdial/wvdialconf || true
|
||||
db_input low wvdial/wvdialconf || true
|
||||
;;
|
||||
2)
|
||||
db_get wvdial/wvdialconf
|
||||
if [ "$RET" = "true" ]; then
|
||||
db_input high wvdial/phone || true
|
||||
update_db 'Dialer Defaults/Phone' wvdial/phone
|
||||
db_input medium wvdial/phone || true
|
||||
fi
|
||||
;;
|
||||
3)
|
||||
db_get wvdial/wvdialconf
|
||||
if [ "$RET" = "true" ]; then
|
||||
db_input high wvdial/login || true
|
||||
update_db 'Dialer Defaults/Username' wvdial/login
|
||||
db_input medium wvdial/login || true
|
||||
fi
|
||||
;;
|
||||
4)
|
||||
db_get wvdial/wvdialconf
|
||||
if [ "$RET" = "true" ]; then
|
||||
db_input high wvdial/passphrase || true
|
||||
db_input high wvdial/passphrase2 || true
|
||||
update_db 'Dialer Defaults/Password' wvdial/passphrase
|
||||
update_db 'Dialer Defaults/Password' wvdial/passphrase2
|
||||
db_input medium wvdial/passphrase || true
|
||||
db_input medium wvdial/passphrase2 || true
|
||||
fi
|
||||
;;
|
||||
5)
|
||||
|
@ -40,7 +62,7 @@ while [ "$STATE" != 0 ] && [ "$STATE" -le "$LASTSTATE" ]; do
|
|||
PASSPHRASE="$RET"
|
||||
db_get wvdial/passphrase2
|
||||
if [ "$RET" != "$PASSPHRASE" ]; then
|
||||
db_input high wvdial/passphrases_mismatch || true
|
||||
db_input medium wvdial/passphrases_mismatch || true
|
||||
db_reset wvdial/passphrase
|
||||
db_reset wvdial/passphrase2
|
||||
db_fset wvdial/passphrase seen false
|
||||
|
|
|
@ -4,37 +4,24 @@ set -e
|
|||
|
||||
if [ "$1" = "configure" ]; then
|
||||
|
||||
# Should really deal with this by parsing wvdial.conf and detecting
|
||||
# if someone has changed anything.
|
||||
set +e
|
||||
skip=""
|
||||
if grep -qi ^phone /etc/wvdial.conf 2>/dev/null; then
|
||||
if grep -qi ^modem /etc/wvdial.conf 2>/dev/null; then
|
||||
echo
|
||||
echo "/etc/wvdial.conf already exists -- leaving it alone."
|
||||
echo " (Run wvdialconf manually if you want to re-detect your modem.)"
|
||||
echo
|
||||
skip="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$skip" ]; then
|
||||
set -e
|
||||
# Source Debconf module
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Source debconf library.
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
db_get wvdial/wvdialconf
|
||||
if [ "$RET" = "true" ]; then
|
||||
db_get wvdial/phone
|
||||
phone="$RET"
|
||||
db_get wvdial/login
|
||||
login="$RET"
|
||||
db_get wvdial/passphrase
|
||||
password="$RET"
|
||||
db_reset wvdial/passphrase
|
||||
db_reset wvdial/passphrase2
|
||||
# Update the /etc/wvdial.conf file
|
||||
db_get wvdial/wvdialconf
|
||||
if [ "$RET" = "true" ]; then
|
||||
db_get wvdial/phone
|
||||
phone="$RET"
|
||||
db_get wvdial/login
|
||||
login="$RET"
|
||||
db_get wvdial/passphrase
|
||||
password="$RET"
|
||||
db_reset wvdial/passphrase
|
||||
db_reset wvdial/passphrase2
|
||||
|
||||
if [ ! -e '/etc/wvdial.conf' ]; then
|
||||
# Create /etc/wvdial.conf
|
||||
umask 077
|
||||
cat >/etc/wvdial.conf <<-EOF
|
||||
|
@ -46,16 +33,39 @@ if [ "$1" = "configure" ]; then
|
|||
EOF
|
||||
chown root:dialout /etc/wvdial.conf
|
||||
chmod 0640 /etc/wvdial.conf
|
||||
|
||||
# Try to detect the modem
|
||||
elif type uni >/dev/null 2>/dev/null; then
|
||||
export UNICONF='ini:/etc/wvdial.conf'
|
||||
if [ -n "$phone" ]; then
|
||||
uni set '/Dialer Defaults/Phone' "$phone"
|
||||
uni del '/Dialer Defaults/; Phone'
|
||||
fi
|
||||
if [ -n "$login" ]; then
|
||||
uni set '/Dialer Defaults/Username' "$login"
|
||||
uni del '/Dialer Defaults/; Username'
|
||||
fi
|
||||
if [ -n "$password" ]; then
|
||||
uni set '/Dialer Defaults/Password' "$password"
|
||||
uni del '/Dialer Defaults/; Password'
|
||||
fi
|
||||
fi
|
||||
|
||||
if grep -qi ^modem /etc/wvdial.conf 2>/dev/null; then
|
||||
echo
|
||||
echo "/etc/wvdial.conf already exists -- not probing your modem."
|
||||
echo " (Run wvdialconf manually if you want to re-detect your modem.)"
|
||||
echo
|
||||
else
|
||||
# Try to detect the modem
|
||||
if wvdialconf /etc/wvdial.conf; then
|
||||
# success
|
||||
if [ -e /etc/wvdial.conf ]; then
|
||||
chown root:dialout /etc/wvdial.conf
|
||||
chmod 0640 /etc/wvdial.conf
|
||||
fi
|
||||
echo
|
||||
echo "Success! You can run \"wvdial\" to connect to the internet."
|
||||
echo " (You can also change your configuration by editing /etc/wvdial.conf)"
|
||||
echo
|
||||
else
|
||||
# failed
|
||||
echo
|
||||
echo "Sorry. You can retry the autodetection at any time by running \"wvdialconf\"."
|
||||
echo " (Or you can create /etc/wvdial.conf yourself.)"
|
||||
|
|
Loading…
Reference in New Issue