2 .
/usr
/lib
/network
/network
6 [[ -z "$WVDIAL_CTL_FILE" ]] && WVDIAL_CTL_FILE
="/var/run/wvdial-$1.pid"
7 [[ -z "$WVDIAL_FLAGS" ]] && WVDIAL_FLAGS
=""
8 [[ -z "$WVDIAL_PROFILE" ]] && WVDIAL_PROFILE
=$1
10 dtach
-n $WVDIAL_CTL_FILE wvdial
$WVDIAL_FLAGS $WVDIAL_PROFILE
12 if [[ $?
-ne 0 ]]; then
13 report_fail
"WVDIAL connection failed"
17 # Generate a new resolv.conf
18 if [[ -n "$DNS" ]]; then
19 [[ -e /etc
/resolv.conf
]] && cp /etc
/resolv.conf
/tmp
/wvdial-
$1-resolv.conf
21 [[ -n "$DOMAIN" ]] && echo "domain $DOMAIN" >>/etc
/resolv.conf
22 [[ -n "$SEARCH" ]] && echo "search $SEARCH" >>/etc
/resolv.conf
24 for dns
in "${DNS[@]}"; do
25 echo "nameserver $dns" >>/etc
/resolv.conf
27 elif [[ -n "$DNS1" ]]; then # support older 'ethernet' syntax.
28 [[ -e /etc
/resolv.conf
]] && cp /etc
/resolv.conf
/tmp
/wvdial-
$1-resolv.conf
30 [[ -n "$DOMAIN" ]] && echo "domain $DOMAIN" >>/etc
/resolv.conf
31 [[ -n "$SEARCH" ]] && echo "search $SEARCH" >>/etc
/resolv.conf
32 [[ -n "$DNS1" ]] && echo "nameserver $DNS1" >>/etc
/resolv.conf
33 [[ -n "$DNS2" ]] && echo "nameserver $DNS2" >>/etc
/resolv.conf
39 [[ -z "$WVDIAL_CTL_FILE" ]] && WVDIAL_CTL_FILE
="/var/run/wvdial-$1.pid"
41 kill $
(pidof
-o %PPID wvdial
)
43 # Restore an old resolv.conf
44 if [[ -e /tmp
/wvdial-
$1-resolv.conf
]]; then
45 mv -f /tmp
/wvdial-
$1-resolv.conf
/etc
/resolv.conf