user[account_name]=your_user_nameFor example, here's my .dialrc:
tel[account_name]=your_ISP_telephone
pass[account_name]=your_password
tel=P269998 user=a260404@rol.ru pass=szhoinai telrol=P689292 userrol=rol passrol=rol telcredit=P8,22780200 usercredit=uoy_kcuf passcredit=hctibSo, if I will simply run "dial", NoSiD will connect using phone number "P269998" (P means pulse dialing) and username "a260404@rol.ru". If I'll add a parameter to the command, e.g. "dial credit", it will connect using another account. When you want to disconnect, press Ctrl+C.
#!/bin/bash ############################################ # NoSiD - no-dashi dialer v0.2 # # (c)2004 no-dashi, original version # # (c)2004 Anthony Ivanoff, current version # # # # Released under GPLv2 # ############################################ ACCOUNT=$1 d() { export USNAME=`cat ~/.dialrc | grep user$ACCOUNT= | sed s/user$ACCOUNT=//` export PHONE=` cat ~/.dialrc | grep tel$ACCOUNT= | sed s/tel$ACCOUNT=//` export PASSWD=` cat ~/.dialrc | grep pass$ACCOUNT= | sed s/pass$ACCOUNT=//` #echo starting pppd at `date` > ~/pppdlog pppd defaultroute ipcp-accept-local ipcp-accept-remote nodetach connect "chat -E ABORT BUSY ABORT DIALTONE ABORT ANSWER '' ATM1L1 OK 'ATDP\$PHONE' 'ogin:' '\$USNAME' 'word:' '\$PASSWD'" # echo $USNAME $PHONE $PASSWD } ANS_REDIAL="y" while [ $ANS_REDIAL = "y" -o $ANS_REDIAL = "н" ] do d read -n 1 -p "Redial (y/n)? " ANS_REDIAL echo done exit 0
Now, go get yourself wvdial, install it and remove NoSiD. Have fun,#!/bin/bash ############################################ # NoSiD - no-dashi dialer v0.3 # # (c)2004 no-dashi, original version # # (c)2004 Anthony Ivanoff, current version # # # # Released under GPLv2 # ############################################ I=1 ACCOUNT=$1 d() { export USNAME=`cat ~/.dialrc | grep user$ACCOUNT= | sed s/user$ACCOUNT=//` export PHONE=` cat ~/.dialrc | grep tel$ACCOUNT= | sed s/tel$ACCOUNT=//` export PASSWD=` cat ~/.dialrc | grep pass$ACCOUNT= | sed s/pass$ACCOUNT=//` #echo starting pppd at `date` > ~/pppdlog echo -e \=\> "\033[0;33mRetry #$I\033[0;0m" \<\= echo \=\> Dialing... pppd defaultroute ipcp-accept-local ipcp-accept-remote nodetach connect "chat -t 60 -E ABORT BUSY ABORT DIALTONE ABORT ANSWER '' ATM1L1 OK 'ATDP\$PHONE' 'ogin:' '\$USNAME' 'word:' '\$PASSWD'" # echo $USNAME $PHONE $PASSWD # killall nullmailer-send echo Connection terminated at `date` I=$(($I + 1)) } ANS_REDIAL="y" while [ $ANS_REDIAL = "y" -o $ANS_REDIAL = "н" ] do d read -n 1 -p "=> Redial (y/n)? " ANS_REDIAL echo done exit 0