QMAIL+MH設計方案(7)

來源:互聯網
上載者:User
設計 以下的的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



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.