-
Notifications
You must be signed in to change notification settings - Fork 6
Release/4.0.1 #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release/4.0.1 #362
Changes from all commits
3133a34
93ce925
5f91560
21529fb
6ba91e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,79 @@ | ||||||
| #!/bin/sh | ||||||
| #################################################################################### | ||||||
| # If not stated otherwise in this file or this component's LICENSE file the | ||||||
| # following copyright and licenses apply: | ||||||
| # | ||||||
| # Copyright 2024 Comcast Cable Communications Management, LLC | ||||||
| # | ||||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|
Check failure on line 8 in lib/rdk/connectivitycheck.sh
|
||||||
| # 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. | ||||||
| #################################################################################### | ||||||
|
|
||||||
| . /etc/include.properties | ||||||
| . /etc/device.properties | ||||||
|
|
||||||
| if [ -f /lib/rdk/t2Shared_api.sh ]; then | ||||||
| source /lib/rdk/t2Shared_api.sh | ||||||
| fi | ||||||
|
|
||||||
| CONNCHECK_LOG_FILE="$LOG_PATH/NMMonitor.log" | ||||||
| CONNCHECK_FILE="/tmp/connectivity_check_done" | ||||||
| CONNCHECK_TIMEOUT=120 # 2 minutes | ||||||
| CONNCHECK_RETRY_INTERVAL=10 # 10 seconds | ||||||
|
|
||||||
| connectivityCheckLog() | ||||||
| { | ||||||
| echo "$(/bin/timestamp) : $0: $*" >> $CONNCHECK_LOG_FILE | ||||||
| } | ||||||
|
|
||||||
| if [ -n "$CONNECTIVITY_CHECK_URL" ]; then | ||||||
| URL="$CONNECTIVITY_CHECK_URL" | ||||||
| else | ||||||
| connectivityCheckLog "CONNECTIVITY_CHECK_URL not set. Exiting." | ||||||
| if [ ! -f $CONNCHECK_FILE ]; then | ||||||
| touch $CONNCHECK_FILE | ||||||
| fi | ||||||
| t2CountNotify "SYST_WARN_connectivitycheck_nourl_set" | ||||||
| exit 0 | ||||||
| fi | ||||||
|
|
||||||
| # Get start time from /proc/uptime (integer part only) | ||||||
| START=$(cut -d. -f1 /proc/uptime) | ||||||
|
|
||||||
| while true; do | ||||||
| NOW=$(cut -d. -f1 /proc/uptime) | ||||||
| ELAPSED=$((NOW - START)) | ||||||
|
|
||||||
| if [ "$ELAPSED" -ge "$CONNCHECK_TIMEOUT" ]; then | ||||||
| connectivityCheckLog "Failed to get HTTP 204 within $CONNCHECK_TIMEOUT seconds." | ||||||
| if [ ! -f $CONNCHECK_FILE ]; then | ||||||
| touch $CONNCHECK_FILE | ||||||
| fi | ||||||
| t2CountNotify "SYST_WARN_connectivitycheck_time_expire" | ||||||
| exit 0 | ||||||
| fi | ||||||
|
|
||||||
| HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL") | ||||||
|
|
||||||
| if [ "$HTTP_CODE" -eq 204 ]; then | ||||||
|
||||||
| if [ "$HTTP_CODE" -eq 204 ]; then | |
| if [ "${HTTP_CODE:-0}" -eq 204 ]; then |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,6 +103,8 @@ if [ -e /opt/.gstreamer ]; then rm -rf /opt/.gstreamer; fi | |
| if [ -d /opt/persistent/dvr ]; then rm -rf /opt/persistent/dvr; fi | ||
| if [ -d /opt/etc ];then rm -rf /opt/etc;fi | ||
| if [ -d /opt/certs ];then rm -rf /opt/certs; fi | ||
| if [ -d /opt/NetworkManager ];then rm -rf /opt/NetworkManager ; fi | ||
| if [ -d /opt/secure/NetworkManager ];then rm -rf /opt/secure/NetworkManager ; fi | ||
|
Comment on lines
+106
to
+107
|
||
|
|
||
| if [ -f /opt/secure/Apparmor_blocklist ];then rm -rf /opt/secure/Apparmor_blocklist ; fi | ||
|
|
||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file existence check and touch pattern is repeated three times (lines 42-44, 58-60, 69-71). Consider extracting this into a helper function to reduce duplication and improve maintainability.