-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathservice_routed_bci.sh
More file actions
executable file
·103 lines (98 loc) · 3.58 KB
/
service_routed_bci.sh
File metadata and controls
executable file
·103 lines (98 loc) · 3.58 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/sh
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2015 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
#######################################################################
# Copyright [2014] [Cisco Systems, Inc.]
#
# Licensed under the Apache License, Version 2.0 (the \"License\");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an \"AS IS\" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################
#------------------------------------------------------------------
# This script is used to start the routing daemons (zebra and ripd)
# $1 is the calling event (current_wan_state current_lan_state ipv6_prefix)
#------------------------------------------------------------------
source /etc/device.properties
SERVICE_NAME="routed"
case "$1" in
"${SERVICE_NAME}-start")
service_routed start
;;
"${SERVICE_NAME}-stop")
service_routed stop
;;
"${SERVICE_NAME}-restart")
service_routed restart
;;
#----------------------------------------------------------------------------------
# Add other event entry points here
#----------------------------------------------------------------------------------
wan-status)
status=$(sysevent get wan-status)
if [ "$status" == "started" ]; then
service_routed start
elif [ "$status" == "stopped" ]; then
service_routed stop
fi
;;
lan-status)
status=$(sysevent get lan-status)
if [ "$status" == "started" ]; then
service_routed start
elif [ "$status" == "stopped" ]; then
service_routed stop
fi
;;
ripd-restart)
service_routed rip-restart
;;
zebra-restart)
service_routed radv-restart
;;
staticroute-restart)
service_routed radv-restart
;;
ipv6_prefix_delegation)
service_routed radv-restart
;;
# ipv6_nameserver|ipv6_dnssl)
# service_routed radv-restart
# ;;
ipv6_prefix|ipv6_nameserver)
if [ "$MODEL_NUM" = "DPC3941B" ] || [ "$MODEL_NUM" = "DPC3939B" ] || [ "$MODEL_NUM" = "CGA4131COM" ] || [ "$MODEL_NUM" = "CGA4332COM" ] || [ "$MODEL_NUM" = "SG417DBCT" ]; then
service_routed radv-restart
fi
;;
dhcpv6_option_changed)
service_routed radv-restart
;;
*)
echo "Usage: $SERVICE_NAME [ ${SERVICE_NAME}-start | ${SERVICE_NAME}-stop | ${SERVICE_NAME}-restart]" > /dev/console
exit 3
;;
esac
exit 0