-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunppp
executable file
·63 lines (56 loc) · 1.16 KB
/
runppp
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
SPEED="38400"
TTY="/dev/ttyS0"
IP="195.146.18.245:195.146.18.246"
DEBUG=0
LOCKFILEPREFIX="/var/lock/LCK.."
LOCKFILESUFFIX="ttyS0"
if [ "$1" = "-h" -o "$1" = "--help" ]; then
echo "$0: Usage:"
echo " $0 [-d] [speed] [tty [local:remote]]]"
echo ""
echo "Defaults:"
echo " Speed: $SPEED"
echo " TTY: $TTY"
echo " IP: $IP"
echo " LockName: $LOCKFILESUFFIX"
exit 0
fi
if [ "$1" = "-d" ]; then
DEBUG=1
shift
fi
if [ "$1" != "" ]; then
expr "$1" + "1" 2> /dev/null > /dev/null
if [ "$?" = "0" ]; then
SPEED="$1"
echo "Using speed $SPEED."
shift
fi
fi
if [ "$1" != "" ]; then
TTY="$1"
if [ ! -c "$TTY" ]; then
TTY="/dev/$1"
fi
if [ ! -c "$TTY" ]; then
TTY="/dev/tty$1"
fi
if [ ! -c "$TTY" ]; then
echo "Incorrect TTY "\""$1"\"". Aborting."
exit 1
fi
echo "Using TTY $TTY."
fi
if [ "$2" != "" ]; then
IP="$2"
echo "Using IP $IP"
fi
echo "Running pppd..."
if [ "$DEBUG" = "1" ]; then
/usr/sbin/pppd -d -d -d -d -d -d -d -d -d -d passive -defaultroute -detach local "$IP" "$TTY" "$SPEED" netmask 255.255.255.252
else
/usr/sbin/pppd passive -defaultroute -detach local "$IP" "$TTY" "$SPEED" netmask 255.255.255.252
fi
# -crtscts
# kdebug 1