mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 02:38:03 +00:00 
			
		
		
		
	WIP: fixing script, broken
This commit is contained in:
		| @@ -13,25 +13,27 @@ GUIDIR="${HL}/LANforgeGUI_${verNum}" | |||||||
| ST="/tmp/summary.txt" | ST="/tmp/summary.txt" | ||||||
| IP="192.168.95.239" | IP="192.168.95.239" | ||||||
|  |  | ||||||
| numFound=$(find ${GUIDIR} -name down-check -mmin 60 | grep -c down-check) | if [ -f ${GUIDIR}/down-check ]; then  | ||||||
| if [[  $numFound == 1 ]]; then |    numFound=`find ${GUIDIR} -name down-check -mmin +59 | grep -c down-check` | ||||||
|   ping -c2 -i1 -nq -w2 -W2 ${IP} |  | ||||||
|   if [[ 1 != $? ]]; then |  | ||||||
|     touch "${GUIDIR}/down-check" |  | ||||||
|     echo "Could not connect to ${IP}" |  | ||||||
|     exit 1 |  | ||||||
|   else |  | ||||||
|     rm "${GUIDIR}/down-check" |  | ||||||
|   fi |  | ||||||
| else |  | ||||||
|     ping -c2 -i1 -nq -w2 -W2 ${IP} |  | ||||||
|   if [[ 1 != $? ]]; then |  | ||||||
|     touch "${GUIDIR}/down-check" |  | ||||||
|     echo "Could not connect to ${IP}" |  | ||||||
|     exit 1 |  | ||||||
|   fi |  | ||||||
| fi |  | ||||||
|  |  | ||||||
|  |    if (( numFound >= 1 )); then | ||||||
|  |      ping -c2 -i1 -nq -w4 -W8 ${IP} | ||||||
|  |      if (( 0 == $? )); then | ||||||
|  |        rm "${GUIDIR}/down-check" | ||||||
|  |      else | ||||||
|  |        touch "${GUIDIR}/down-check" | ||||||
|  |        echo "Could not connect to ${IP}" | ||||||
|  |        exit 1 | ||||||
|  |      fi | ||||||
|  |    else | ||||||
|  |      ping -c2 -i1 -nq -w4 -W4 ${IP} | ||||||
|  |      if (( 0 != $? )); then | ||||||
|  |        touch "${GUIDIR}/down-check" | ||||||
|  |        echo "Could not connect to ${IP}" | ||||||
|  |        exit 1 | ||||||
|  |      fi | ||||||
|  |    fi | ||||||
|  | fi | ||||||
|  |  | ||||||
| rm -f /tmp/*.txt | rm -f /tmp/*.txt | ||||||
| rm -f $GUILog $GUIUpdate $CTLGUI $CTLH $ST | rm -f $GUILog $GUIUpdate $CTLGUI $CTLH $ST | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jed Reynolds
					Jed Reynolds