File: unicorn-ipoatm

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 (68 lines) | stat: -rwxr-xr-x 1,036 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
#!/bin/sh

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

#LOC_IP=0.0.0.0
#NETMASK=255.255.255.255
#GW=0.0.0.0

# set to correct product (USB or PCI)
UNICORN="unicorn_pci_eth"
#UNICORN="unicorn_usb_eth"

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

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

# standard setting for IP over ATM
PROTOCOL=ipoatm
ENCAPS=null

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

stop () {
	/sbin/ifconfig dsl0 down >/dev/null 2>&1
	/sbin/modprobe -r $UNICORN >/dev/null 2>&1
	return $?
}

start() {
	/sbin/modprobe $UNICORN PROTOCOL=$PROTOCOL ActivationMode=$MODULATION VPI=$VPI VCI=$VCI
   	[ ! "$?" = 0 ] && return $?
	/sbin/ifconfig dsl0 up
	#/sbin/ifconfig dsl $LOC_IP netmask $NETMASK
	#/sbin/route add gw $GW
	return 0
}

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