diff --git a/DCMscript.sh b/DCMscript.sh index a172633..a18b2ab 100755 --- a/DCMscript.sh +++ b/DCMscript.sh @@ -116,8 +116,6 @@ HTTP_CODE=/tmp/.dcm_http_code RETRY_DELAY=60 MAX_SSH_RETRY=3 -UseLANIFIPV6=`sysevent get LANIPv6GUASupport` - if [ "x$BOX_TYPE" = "xSR300" ] ;then while : do @@ -457,12 +455,8 @@ sendHttpRequestToServer() # If interface doesnt have ipv6 address then we will force the curl to go with ipv4. # Otherwise we will not specify the ip address family in curl options - if [ "x$BOX_TYPE" = "xHUB4" ] || [ "x$BOX_TYPE" = "xSR300" ] || [ "x$BOX_TYPE" = "xSR213" ] || [ "x$BOX_TYPE" = "xSE501" ] || [ "x$BOX_TYPE" = "xWNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then - addr_type="" - else - addr_type="" - [ "x`ifconfig $EROUTER_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" - fi + addr_type="" + [ "x`ifconfig $EROUTER_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" partnerId=$(getPartnerId) accountId=$(getAccountId) if [ $MODEL_NUM = "WNXL11BWL" ]; then diff --git a/dcaSplunkUpload.sh b/dcaSplunkUpload.sh index 1cd3bfe..39b89a0 100755 --- a/dcaSplunkUpload.sh +++ b/dcaSplunkUpload.sh @@ -55,7 +55,6 @@ DCMRESPONSE="$PERSISTENT_PATH/DCMresponse.txt" PEER_COMM_ID="/tmp/elxrretyt-dcas.swr" -UseLANIFIPV6=`sysevent get LANIPv6GUASupport` if [ ! -f /usr/bin/GetConfigFile ];then echo "Error: GetConfigFile Not Found" @@ -357,16 +356,7 @@ cur_time=`date "+%Y-%m-%d %H:%M:%S"` # If interface doesnt have ipv6 address then we will force the curl to go with ipv4. # Otherwise we will not specify the ip address family in curl options addr_type="" -if [ "x$BOX_TYPE" = "xHUB4" ] || [ "x$BOX_TYPE" = "xSR300" ] || [ "x$BOX_TYPE" = "xSR213" ] || [ "x$BOX_TYPE" = "xSE501" ] || [ "x$BOX_TYPE" = "xWNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then - CURRENT_WAN_IPV6_STATUS=`sysevent get ipv6_connection_state` - if [ "xup" = "x$CURRENT_WAN_IPV6_STATUS" ] ; then - [ "x`ifconfig $HUB4_IPV6_INTERFACE | grep Global | awk '/inet6/{print $3}' | cut -d '/' -f1 | head -n1`" != "x" ] || addr_type="-4" - else - [ "x`ifconfig $EROUTER_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" - fi -else - [ "x`ifconfig $EROUTER_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" -fi +[ "x`ifconfig $EROUTER_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" if [ "x$DCA_MULTI_CORE_SUPPORTED" = "xyes" ]; then ## 1] Pull processed data from ATOM rm -f $TELEMETRY_JSON_RESPONSE diff --git a/onboardLogUpload.sh b/onboardLogUpload.sh index f6cde37..86e83d3 100755 --- a/onboardLogUpload.sh +++ b/onboardLogUpload.sh @@ -58,8 +58,6 @@ CODEBIG_MAX_ATTEMPTS=3 EnableOCSPStapling="/tmp/.EnableOCSPStapling" EnableOCSP="/tmp/.EnableOCSPCA" -UseLANIFIPV6=`sysevent get LANIPv6GUASupport` - if [ -f $EnableOCSPStapling ] || [ -f $EnableOCSP ]; then CERT_STATUS="--cert-status" fi @@ -241,16 +239,7 @@ uploadOnboardLogs() # If interface doesnt have ipv6 address then we will force the curl to go with ipv4. # Otherwise we will not specify the ip address family in curl options addr_type="" -if [ "x$BOX_TYPE" = "xHUB4" ] || [ "x$BOX_TYPE" = "xSR300" ] || [ "x$BOX_TYPE" == "xSR213" ] || [ "x$BOX_TYPE" == "xSE501" ] || [ "x$BOX_TYPE" == "xWNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then - CURRENT_WAN_IPV6_STATUS=`sysevent get ipv6_connection_state` - if [ "xup" = "x$CURRENT_WAN_IPV6_STATUS" ] ; then - [ "x`ifconfig $HUB4_IPV6_INTERFACE | grep Global | awk '/inet6/{print $3}' | cut -d '/' -f1 | head -n1`" != "x" ] || addr_type="-4" - else - [ "x`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" - fi -else [ "x`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" -fi S3_URL=$UploadHttpLink S3_MD5SUM="" diff --git a/opsLogUpload.sh b/opsLogUpload.sh index ec44694..34e0c0c 100755 --- a/opsLogUpload.sh +++ b/opsLogUpload.sh @@ -39,8 +39,6 @@ source /etc/device.properties source /lib/rdk/getpartnerid.sh source $RDK_LOGGER_PATH/logUpload_default_params.sh -UseLANIFIPV6=`sysevent get LANIPv6GUASupport` - if [ -f /nvram/logupload.properties -a $BUILD_TYPE != "prod" ];then . /nvram/logupload.properties fi @@ -302,16 +300,8 @@ HTTPLogUploadOnRequest() # If interface doesnt have ipv6 address then we will force the curl to go with ipv4. # Otherwise we will not specify the ip address family in curl options addr_type="" -if [ "x$BOX_TYPE" = "xHUB4" ] || [ "x$BOX_TYPE" = "xSR300" ] || [ "x$BOX_TYPE" == "xSR213" ] || [ "x$BOX_TYPE" == "xSE501" ] || [ "x$BOX_TYPE" == "xWNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then - CURRENT_WAN_IPV6_STATUS=`sysevent get ipv6_connection_state` - if [ "xup" = "x$CURRENT_WAN_IPV6_STATUS" ] ; then - [ "x`ifconfig $HUB4_IPV6_INTERFACE | grep Global | awk '/inet6/{print $3}' | cut -d '/' -f1 | head -n1`" != "x" ] || addr_type="-4" - else - [ "x`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" - fi -else [ "x`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" -fi + UploadFile=`ls | grep "tgz"` echo_t "files to be uploaded is : $UploadFile" diff --git a/startTunnel.sh b/startTunnel.sh index 3b44901..37d73f0 100755 --- a/startTunnel.sh +++ b/startTunnel.sh @@ -24,9 +24,6 @@ source /etc/waninfo.sh -UseLANIFIPV6=`sysevent get LANIPv6GUASupport` - - if [ -f /lib/rdk/t2Shared_api.sh ]; then source /lib/rdk/t2Shared_api.sh fi @@ -70,26 +67,9 @@ case $oper in IpCheckVal=$(echo ${CM_IPV4} | tr "." " " | awk '{ print $3"."$4 }') Check=$(ip_to_hex $IpCheckVal) # getting the IPV6 address for CM - if [ "$BOX_TYPE" = "SCER11BEL" -a "$UseLANIFIPV6" = "true" ] ; then - if [ -z "$CM_IPV4" ]; then - # In IPv6 only case (MAP-T), and if IPv6 GUA on LAN enabled case, use brlan0 interface to get v6 global address. - CM_IP=`ip -6 addr show dev brlan0 scope global | awk '/inet/{print $2}' | cut -d '/' -f1 | head -n1` - else - CM_IP=$CM_IPV4 - fi - echo "CM_IP-$CM_IP" - # creating a ssh tunnel directly to the LANIP:22 for IPV6 only scenario - elif [ "x$BOX_TYPE" = "xHUB4" ] || [ "x$BOX_TYPE" = "xSR300" ] || [ "x$BOX_TYPE" = "xSR213" ] || [ "x$BOX_TYPE" = "xSE501" ] || [ "x$BOX_TYPE" = "xWNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then - if [ -z "$CM_IPV4" ]; then - CM_IP=`syscfg get lan_ipaddr` - else - CM_IP=$CM_IPV4 - fi - else - CM_IP=`ifconfig $WAN_INTERFACE | grep Global | awk '/inet6/{print $3}' | cut -d '/' -f1` - if [ -z "$CM_IP" ]; then - CM_IP=$CM_IPV4 - fi + CM_IP=`ifconfig $WAN_INTERFACE | grep Global | awk '/inet6/{print $3}' | cut -d '/' -f1` + if [ -z "$CM_IP" ]; then + CM_IP=$CM_IPV4 fi else if ( [ "$MANUFACTURE" = "Technicolor" ] || [ "$MANUFACTURE" = "Sercomm" ] ) && [ "$BOX_TYPE" != "XB3" ]; then diff --git a/uploadRDKBLogs.sh b/uploadRDKBLogs.sh index 1fadac2..26feba4 100755 --- a/uploadRDKBLogs.sh +++ b/uploadRDKBLogs.sh @@ -65,7 +65,6 @@ partnerId="$(getPartnerId)" unscheduledDisable=`syscfg get UploadLogsOnUnscheduledRebootDisable` UPLOAD_LOGS=`sysevent get UPLOAD_LOGS_VAL_DCM` -UseLANIFIPV6=`sysevent get LANIPv6GUASupport` if [ "$UPLOAD_LOGS" = "" ] || [ ! -f "$DCM_SETTINGS_PARSED" ] then @@ -250,19 +249,10 @@ retryUpload() sleep 10 WAN_INTERFACE=$(getWanInterfaceName) WAN_STATE=`sysevent get wan-status` -if [ "x$BOX_TYPE" = "xHUB4" ] || [ "x$BOX_TYPE" = "xSR300" ] || [ "x$BOX_TYPE" = "xSR213" ] || [ "x$BOX_TYPE" = "xSE501" ] || [ "x$BOX_TYPE" = "xWNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then - CURRENT_WAN_IPV6_STATUS=`sysevent get ipv6_connection_state` - if [ "xup" = "x$CURRENT_WAN_IPV6_STATUS" ] ; then - EROUTER_IP=`ifconfig $HUB4_IPV6_INTERFACE | grep Global | awk '/inet6/{print $3}' | cut -d '/' -f1 | head -n1` - else - EROUTER_IP=`ifconfig $WAN_INTERFACE | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1` - fi -else - EROUTER_IP=`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'` - if [ "$EROUTER_IP" = "" ]; then - EROUTER_IP=`ifconfig $WAN_INTERFACE | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1` - fi -fi + EROUTER_IP=`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'` + if [ "$EROUTER_IP" = "" ]; then + EROUTER_IP=`ifconfig $WAN_INTERFACE | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1` + fi SYSEVENT_PID=`pidof syseventd` if [ -f $WAITINGFORUPLOAD ] then @@ -475,16 +465,8 @@ HttpLogUpload() # If interface doesnt have ipv6 address then we will force the curl to go with ipv4. # Otherwise we will not specify the ip address family in curl options addr_type="" - if [ "x$BOX_TYPE" = "xHUB4" ] || [ "x$BOX_TYPE" = "xSR300" ] || [ "x$BOX_TYPE" = "xSR213" ] || [ "x$BOX_TYPE" = "xSE501" ] || [ "x$BOX_TYPE" = "xWNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then - CURRENT_WAN_IPV6_STATUS=`sysevent get ipv6_connection_state` - if [ "xup" = "x$CURRENT_WAN_IPV6_STATUS" ] ; then - [ "x`ifconfig $HUB4_IPV6_INTERFACE | grep Global | awk '/inet6/{print $3}' | cut -d '/' -f1 | head -n1`" != "x" ] || addr_type="-4" - else - [ "x`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" - fi - else - [ "x`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" - fi + [ "x`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'`" != "x" ] || addr_type="-4" + # Upload logs to "LOG_BACK_UP_REBOOT" upon reboot else to the default path "LOG_BACK_UP_PATH" if [ "$UploadOnReboot" == "true" ]; then if [ "$nvram2Backup" == "true" ]; then @@ -876,19 +858,11 @@ touch $REGULAR_UPLOAD if [ "$UploadProtocol" = "HTTP" ] then WAN_STATE=`sysevent get wan-status` -if [ "x$BOX_TYPE" = "xHUB4" ] || [ "x$BOX_TYPE" = "xSR300" ] || [ "x$BOX_TYPE" = "xSR213" ] || [ "x$BOX_TYPE" = "xSE501" ] || [ "x$BOX_TYPE" = "xWNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then - CURRENT_WAN_IPV6_STATUS=`sysevent get ipv6_connection_state` - if [ "xup" = "x$CURRENT_WAN_IPV6_STATUS" ] ; then - EROUTER_IP=`ifconfig $HUB4_IPV6_INTERFACE | grep Global | awk '/inet6/{print $3}' | cut -d '/' -f1 | head -n1` - else - EROUTER_IP=`ifconfig $WAN_INTERFACE | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1` + + EROUTER_IP=`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'` + if [ "$EROUTER_IP" = "" ]; then + EROUTER_IP=`ifconfig $WAN_INTERFACE | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1` fi -else - EROUTER_IP=`ifconfig $WAN_INTERFACE | grep inet6 | grep -i 'Global'` - if [ "$EROUTER_IP" = "" ]; then - EROUTER_IP=`ifconfig $WAN_INTERFACE | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1` - fi -fi SYSEVENT_PID=`pidof syseventd` if [ "$WAN_STATE" == "started" ] && [ "$EROUTER_IP" != "" ] then diff --git a/utils.sh b/utils.sh index 20d85f1..836808e 100755 --- a/utils.sh +++ b/utils.sh @@ -92,17 +92,11 @@ getSHA1() # IP address of the machine getIPAddress() { - if [ "x$BOX_TYPE" = "xHUB4" ] || [ "x$BOX_TYPE" = "xSR300" ] || [ "x$BOX_TYPE" = "xSR213" ] || [ "x$BOX_TYPE" = "xSE501" ] || [ "x$BOX_TYPE" = "xWNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then - - CURRENT_WAN_IPV6_STATUS=`sysevent get ipv6_connection_state` - if [ "xup" = "x$CURRENT_WAN_IPV6_STATUS" ] ; then - wanIP=`ifconfig $HUB4_IPV6_INTERFACE | grep Global | awk '/inet6/{print $3}' | cut -d '/' -f1 | head -n1` - else - wanIP=`ifconfig $WANINTERFACE | grep "inet addr" | grep -v inet6 | cut -f2 -d: | cut -f1 -d" "` - fi - else - wanIP=`ifconfig $WANINTERFACE | grep "inet addr" | grep -v inet6 | cut -f2 -d: | cut -f1 -d" "` + wanIP=`ifconfig $WANINTERFACE | grep inet6 | grep -i 'Global' | awk '/inet6/{print $3}' | cut -d '/' -f1 | head -n1` + if [ -z "$wanIP" ]; then + wanIP=`ifconfig $WANINTERFACE | grep "inet addr" | grep -v inet6 | cut -f2 -d: | cut -f1 -d" "` fi + echo $wanIP } @@ -116,7 +110,7 @@ getCMIPAddress() elif [ "$BOX_TYPE" = "HUB4" ] || [ "$BOX_TYPE" = "SR300" ] || [ "x$BOX_TYPE" = "xSR213" ] || [ "$BOX_TYPE" = "SE501" ] || [ "$BOX_TYPE" = "WNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then CURRENT_WAN_IPV6_STATUS=`sysevent get ipv6_connection_state` if [ "xup" = "x$CURRENT_WAN_IPV6_STATUS" ] ; then - address=`ifconfig $HUB4_IPV6_INTERFACE | grep inet6 | grep Global | awk '/inet6/{print $3}' | grep -v 'fdd7' | cut -d '/' -f1 | head -n1` + address=`ifconfig $WANINTERFACE | grep inet6 | grep Global | awk '/inet6/{print $3}' | grep -v 'fdd7' | cut -d '/' -f1 | head -n1` else address=`ifconfig $WANINTERFACE | grep "inet addr" | grep -v inet6 | cut -f2 -d: | cut -f1 -d" "` fi @@ -140,18 +134,11 @@ getErouterIPAddress() if [ ! "$address" ]; then address=`dmcli eRT retv Device.DeviceInfo.X_COMCAST-COM_WAN_IP` fi - elif [ "$BOX_TYPE" = "HUB4" ] || [ "$BOX_TYPE" = "SR300" ] || [ "x$BOX_TYPE" = "xSR213" ] || [ "$BOX_TYPE" = "SE501" ] || [ "$BOX_TYPE" = "WNXL11BWL" ] || [ "$UseLANIFIPV6" = "true" ]; then - CURRENT_WAN_IPV6_STATUS=`sysevent get ipv6_connection_state` - if [ "xup" = "x$CURRENT_WAN_IPV6_STATUS" ] ; then - address=`ifconfig $HUB4_IPV6_INTERFACE | grep inet6 | grep Global | awk '/inet6/{print $3}' | grep -v 'fdd7' | cut -d '/' -f1 | head -n1` - else - address=`ifconfig $WANINTERFACE | grep "inet addr" | grep -v inet6 | cut -f2 -d: | cut -f1 -d" "` - fi elif [ $BOX_TYPE = "XF3" ]; then # in PON/DSL you cant get the CM IP address, so use eRouter IP address address=`ifconfig $WANINTERFACE | grep "inet addr" | grep -v inet6 | cut -f2 -d: | cut -f1 -d" "` else - address=`ifconfig -a $WANINTERFACE | grep inet6 | tr -s " " | grep -v Link | cut -d " " -f4 | cut -d "/" -f1` + address=`ifconfig -a $WANINTERFACE | grep inet6 | grep Global | awk '/inet6/{print $3}' | grep -v 'fdd7' | cut -d '/' -f1 | head -n1` if [ ! "$address" ]; then address=`ifconfig -a $WANINTERFACE | grep inet | grep -v inet6 | tr -s " " | cut -d ":" -f2 | cut -d " " -f1` fi