File: ping.test

package info (click to toggle)
wolfssl 5.5.4-2%2Bdeb12u2
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 88,476 kB
  • sloc: ansic: 1,245,989; asm: 281,930; sh: 7,916; xml: 3,204; cs: 2,866; makefile: 1,116; javascript: 748; perl: 350; cpp: 97; objc: 80; tcl: 73
file content (29 lines) | stat: -rwxr-xr-x 420 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

# ping.test

# defaults
server=www.wolfssl.com
tries=2

# populate args
if [ "$#" -gt 1 ]; then
    tries=$2
fi
if [ "$#" -gt 0 ]; then
    server=$1
fi

# determine os
OS="`uname`"
case $OS in
    MINGW* | MSYS*) PINGSW=-n ;;
    *) PINGSW=-c ;;
esac

# is our desired server there?
ping $PINGSW $tries $server
RESULT=$?
[ $RESULT -ne 0 ] && echo -e "\n\nCouldn't find $server, skipping" && exit 1

exit 0