File: unicorn-pppoatm

package info (click to toggle)
unicorn 0.8.7-1.1
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 3,984 kB
  • ctags: 3,428
  • sloc: ansic: 20,028; cpp: 1,265; sh: 1,033; makefile: 710; yacc: 316; sed: 16
file content (71 lines) | stat: -rwxr-xr-x 1,139 bytes parent folder | download | duplicates (2)
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
63
64
65
66
67
68
69
70
71
#!/bin/sh

# Source function library.
. /etc/rc.d/init.d/functions

# set to correct product (USB or PCI)
UNICORN="unicorn_pci_atm"
#UNICORN="unicorn_usb_atm"

# default VPI, VCI and encapsulation
VPI=8
VCI=35

# ANSI=1,G.lite=2,MULTI=3,G.dmt=4,
MODULATION=1

# pppd version 2.4.0b2 patched
#PPPD="/usr/src/ppp-2.4.0b2/pppd/pppd"
#PLUGIN="/usr/lib/pppd/plugins/pppoatm.so"

# pppd version 2.4.1
PPPD="/usr/sbin/pppd"
PLUGIN="/usr/lib/pppd/2.4.1/pppoatm.so"

RETVAL=0

stop() {
    killproc $PPPD >/dev/null 2>&1
    /sbin/modprobe -r $UNICORN >/dev/null 2>&1
}

start() {
    /sbin/modprobe pppoatm
    [ ! "$?" = 0 ] && return $?
    /sbin/modprobe $UNICORN ActivationMode=$MODULATION >/dev/null 2>&1
    [ ! "$?" = 0 ] && return $?
    sleep 10
    $PPPD plugin $PLUGIN $VPI.$VCI
    [ ! "$?" = 0 ] && return $?
    return 0
}

echo -n "$1 $UNICORN $PROTOCOL $VPI.$VCI $ENCAPS"

case "$1" in
    stop)
	stop
	;;
    
    start)
	start
	;;	
    
    restart)
	stop
	start
	;;
    
    *)
	echo $"Usage: $0 {start|stop|restart}"
	exit 1
esac

RETVAL=$?
if [ $RETVAL = 0 ]; then
    echo_success
else 
    echo_failure
fi
echo
exit $RETVAL