This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
cosa_start_wifiagent.sh
executable file
·106 lines (85 loc) · 3.22 KB
/
cosa_start_wifiagent.sh
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
104
105
106
##########################################################################
# If not stated otherwise in this file or this component's LICENSE
# 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.
#######################################################################
BINPATH="/usr/bin"
if [ -f /etc/device.properties ]
then
source /etc/device.properties
fi
CRONFILE=$CRON_SPOOL"/root"
CRONFILE_BK="/tmp/cron_tab$$.txt"
killall CcspWifiSsp
DEVICEMODELEXISTS=`cat /etc/device.properties | grep DEVICE_MODEL | cut -f2 -d=`
if [[ $DEVICEMODELEXISTS == "TCHXB3" ]]; then
# have IP address for dbus config generated
vconfig add eth0 500
ifconfig eth0.500 169.254.101.2
fi
source /etc/utopia/service.d/log_capture_path.sh
export LD_LIBRARY_PATH=$PWD:.:$PWD/../../lib:$PWD/../../.:/lib:/usr/lib:$LD_LIBRARY_PATH
export LOG4C_RCPATH=/etc
# enable core files on atom
ulimit -c unlimited
echo "/tmp/core.%e.%p" > /proc/sys/kernel/core_pattern
cp -f ccsp_msg.cfg /tmp
Subsys="eRT."
echo "Elected subsystem is $Subsys"
sleep 1
if [ -e ./wifi ]; then
cd wifi
if [ "x"$Subsys = "x" ];then
echo "****STARTING CCSPWIFI WITHOUT SUBSYS***"
$BINPATH/CcspWifiSsp &
else
echo "****STARTING CCSPWIFI WITH SUBSYS***"
echo "$BINPATH/CcspWifiSsp -subsys $Subsys &"
$BINPATH/CcspWifiSsp -subsys $Subsys &
fi
fi
if [[ $DEVICEMODELEXISTS == "TCHXB3" ]]; then
echo "starting process monitor script"
sh /usr/ccsp/wifi/process_monitor_atom.sh &
fi
echo "Start monitoring wifi system statistics"
if [ -f $CRONFILE ]
then
# Dump existing cron jobs to a file & add new job
crontab -l -c $CRON_SPOOL > $CRONFILE_BK
# Check whether specific cron job is existing or not
existing_cron=$(grep "aphealth_log.sh" $CRONFILE_BK)
if [ -z "$existing_cron" ]; then
echo "1 * * * * /usr/ccsp/wifi/aphealth_log.sh" >> $CRONFILE_BK
crontab $CRONFILE_BK -c $CRON_SPOOL
fi
rm -rf $CRONFILE_BK
fi