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