鸿 网 互 联 www.68idc.cn

QMAIL+MH设计方案(7)

来源:互联网 作者:佚名 时间:2013-04-18 10:00
牛图库(niutuku.com)素材网提供,等设计素材免费下载。
QMAIL+MH设计方案(7)内容简介:以下的的rc.config文件装载了初始化的必要组元。 #!/bin/bash # This is adapted Bernhard Hailers old script LOCAL_NUMBER="91311234" # tel no. 091311234 REMOTE_NUMBER="0911123456" # ISP tel no. LOCAL_IP="192.168.0.99" # I have dynamic IP so this will d

关键词:

以下的的rc.config文件装载了初始化的必要组元。

#!/bin/bash
# This is adapted Bernhard Hailers old script
LOCAL_NUMBER="91311234" # tel no. 091311234
REMOTE_NUMBER="0911123456" # ISP tel no.
LOCAL_IP="192.168.0.99" # I have dynamic IP so this will do
REMOTE_IP="195.112.123.11" # your ISPs gateway
DEVICE="ippp0"
SYSPATH="/sbin"
ISDNCTRL="$SYSPATH/isdnctrl"
case "$1" in
start)
# turn on isdn
insmod /lib/modules/2.0.33/net/slhc.o
insmod /lib/modules/2.0.33/misc/isdn.o
sleep 1
# load the hisax module
insmod /lib/modules/2.0.33/misc/hisax.o
id=Tel0 type=5 protocol=2 irq=10 io=0x300
echo "starting isdn4linux"
# global
$ISDNCTRL verbose 0
$ISDNCTRL addif $DEVICE # create new interface
$ISDNCTRL addphone $DEVICE in $REMOTE_NUMBER
$ISDNCTRL addphone $DEVICE out $REMOTE_NUMBER
$ISDNCTRL eaz $DEVICE $LOCAL_NUMBER
$ISDNCTRL l2_prot $DEVICE hdlc
$ISDNCTRL l3_prot $DEVICE trans
$ISDNCTRL encap $DEVICE syncppp
$ISDNCTRL huptimeout $DEVICE 300
$ISDNCTRL chargehup $DEVICE off
$ISDNCTRL secure $DEVICE on
$SYSPATH/ifconfig $DEVICE $LOCAL_IP pointopoint $REMOTE_IP metric 1
$SYSPATH/route add default $DEVICE
$SYSPATH/ipppd /dev/ippp0 file /etc/ppp/options.ipppd &
$SYSPATH/route del default

;;
stop)
#turn off isdn
rmmod hisax.o
sleep 1
rmmod isdn.o
rmmod slhc.o
echo "Shutting down isdn4linux"
$ISDNCTRL delif ippp0
;;
*)
echo "Usage: $0 (start|stop)"
exit 1
;;
esac

网友评论
<