check-for-gopher-service.sh - gopher-lawn - The gopher lawn gopher directory pr… | |
git clone git://bitreich.org/gopher-lawn/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhf… | |
Log | |
Files | |
Refs | |
Tags | |
--- | |
check-for-gopher-service.sh (716B) | |
--- | |
1 #!/bin/sh | |
2 | |
3 if [ "x$WORKER" = x1 ]; | |
4 then | |
5 for port in 70 9999; | |
6 do | |
7 # grep using $port because there are cases (at least one… | |
8 # 1. the frontend is accessible on port 70 but is primar… | |
9 # 2. the frontend is accessible on port 70, the menus ar… | |
10 printf "\r\n" | nc -w 5 "$1" "${port}" 2>/dev/null | \ | |
11 grep "${port}" | grep -q 'Public Timeline' \ | |
12 && printf '%s:%s serves gopher\n' "$1" "${port}"… | |
13 done | |
14 else | |
15 if [ $# -lt 1 ]; | |
16 then | |
17 printf "usage: %s pleroma-servers.txt\n" "$(basename "$0… | |
18 exit 1 | |
19 fi | |
20 | |
21 shuf "$1" | xargs -I '{}' -P 16 sh -c "WORKER=1 '$0' '{}'" | |
22 fi | |
23 |