我用以下技巧拨号
,它被称为简洁的isdn on|off
#!/bin/bash
# This is based on an old script from Bernhard Hailer
IP_ADDRE="195.112.123.11"
case "$1" in
on)
echo "Calling i0"
/in/isdnctrl dial i0
# the sleep is important as it gives the time to settle down
echo "Sleep for 8s for handshake"
sleep 8s
/in/route add default i0
echo "line open - checking...."
# check whether negotiation was succeful:
set `ping -qc3 -i1 $IP_ADDRE 2>/dev/null | grep tramitted`
if [ $4 -gt 0 ];
then
echo "succeeded."
echo "Starting fetchmail daemon"
/usr/bin/fetchmail -d 600 -k -v -a -L /var/log/fetchmail
echo "Flushing mail queue...."
/usr/local/bin/serialmail/maildir2smtp
~alias/dir alias-- mail.server.ip.no `hostname`
else
echo "failed!"
/in/isdnctrl hangup i0
fi
off)
echo -n "Shutting down fetchmail daemon"
/usr/bin/fetchmail --quit
/in/isdnctrl hangup i0
/in/route del default # and delete route
echo "You e off line"
*)
echo -e "aUsage:"
echo "isdn on"
echo "isdn off"
esac