Properly extract KERNEL_PATCHVER for linux 3.0
[openwrt.git] / package / ltq-tapidemo / files / bringup_tapidemo
1 #!/bin/sh /etc/rc.common
2 # (C) 2008 openwrt.org
3
4 START=96
5
6 [ ! -f /dev/vmmc10 ] && {
7 mknod /dev/vmmc10 c 122 10
8 mknod /dev/vmmc11 c 122 11
9 mknod /dev/vmmc12 c 122 12
10 mknod /dev/vmmc13 c 122 13
11 mknod /dev/vmmc14 c 122 14
12 mknod /dev/vmmc15 c 122 15
13 mknod /dev/vmmc16 c 122 16
14 mknod /dev/vmmc17 c 122 17
15 mknod /dev/vmmc18 c 122 18
16 }
17
18 TD_EXTRA_FLAGS_FXO=
19 TD_EXTRA_FLAGS_KPI2UDP=
20 TD_DOWNLOAD_PATH=/lib/firmware/
21 DEV_NODE_TERIDIAN=ter10
22
23 # Show help
24 help()
25 {
26 echo "Usage:"
27 echo " - $0 WAN-IF-NAME - start TAPIDEMO without FXO support"
28 echo " - $0 WAN-IF-NAME fxo - start TAPIDEMO with FXO support."
29 echo " - $0 stop - stop TAPIDEMO"
30 }
31
32 # Check if device node for Teridian exists
33 checkFxoSupport()
34 {
35 if [ ! -e /dev/$DEV_NODE_TERIDIAN ];then
36 echo "FXO support is disabled. Can not find required driver's device node."
37 else
38 TD_EXTRA_FLAGS_FXO="-x"
39 fi
40 }
41
42 # Check if module drv_kpi2udp is loaded
43 checkKpi2UdpSupport()
44 {
45 tmp=`cat /proc/modules | grep 'drv_kpi2udp '`
46 if [ "$tmp" != "" ]; then
47 TD_EXTRA_FLAGS_KPI2UDP="-q"
48 fi
49 }
50
51 start()
52 {
53 TD_WANIF=$1
54
55 TD_WANIF_IP=`ifconfig $TD_WANIF | grep 'inet addr:' | cut -f2 -d: | cut -f1 -d' '`
56 if [ "$TD_WANIF_IP" = "" ]; then
57 echo "Error, getting IP address for network device $TD_WANIF failed."
58 exit 1
59 fi
60
61 if [ "$2" = "" ];then
62 # FXO support is disabled.
63 continue
64 elif [ "$2" = "fxo" ];then
65 checkFxoSupport
66 else
67 echo "Error, unknown second parameter."
68 help
69 exit 1
70 fi
71
72 checkKpi2UdpSupport
73
74 if [ -r /etc/rc.conf ]; then
75 . /etc/rc.conf
76 fi
77
78 TD_DEBUG_LEVEL=$tapiDebugLevel
79 if [ "$TD_DEBUG_LEVEL" = "" ]; then
80 TD_DEBUG_LEVEL=3
81 fi
82
83 /usr/sbin/tapidemo -d $TD_DEBUG_LEVEL $TD_EXTRA_FLAGS_FXO $TD_EXTRA_FLAGS_KPI2UDP -i $TD_WANIF_IP -l $TD_DOWNLOAD_PATH &
84 }
85
86 stop()
87 {
88 killall tapidemo > /dev/null 2> /dev/null
89 }
This page took 0.049529 seconds and 5 git commands to generate.