File: sample.pppscript

package info (click to toggle)
gcpegg 5.1-9
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 328 kB
  • ctags: 445
  • sloc: ansic: 3,706; makefile: 95; sh: 27; csh: 21
file content (30 lines) | stat: -rwxr-xr-x 693 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/csh

if ("$1" == "up") then
  echo "Bringing net up"

  /usr/sbin/pppd connect '/usr/sbin/chat -v ABORT BUSY ABORT "NO CARRIER" "" ATZ OK ATS71=1 OK ATS80=1 OK ATDT4828060 CONNECT ""' /dev/cua0 115200 name halebopp remotename whitehole debug crtscts modem defaultroute 10.0.0.111:10.0.0.116

  # Wait for connection success
  set timer = 8
  while ($timer > 0) 
    if (-e "/var/run/ppp0.pid") exit 0
    sleep 1
    @ timer = $timer - 1
  end

  echo "Couldn't get it up!"
  exit -1
endif

if ("$1" == "down") then
  echo "Bringing net down"
  if (! -e "/var/run/ppp0.pid") exit 0
  set pid = `cat /var/run/ppp0.pid`
  kill $pid

  exit 0
endif

echo "Usage: pppscript up down"
exit 1