Advertisement
CTpaHHoe

download public peers

Oct 4th, 2022
996
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.14 KB | Source Code | 0 0
  1. function download_peer_files() {
  2.   31   │     declare DL
  3.   32   │     declare europe_url america_url
  4.   33   │     europe_url=$(echo "https://raw.githubusercontent.com/yggdrasil-network/public-peers/master/europe/"{czechia,finland,france,germany,netherlands,poland,romania,russia,slovakia,swe
  5.        │ den,united-kingdom}".md")
  6.   34   │     america_url=$(echo "https://raw.githubusercontent.com/yggdrasil-network/public-peers/master/north-america/"{canada,united-states}".md")
  7.   35   │     if command -v wget >& /dev/null; then
  8.   36   │         DL="wget -c --prefer-family=IPv4"
  9.   37   │     elif command -v curl >& /dev/null; then
  10.   38   │         DL="curl -O"
  11.   39   │     else
  12.   40   │         echo "ОШИБКА. wget или curl не найдены"
  13.   41   │     fi
  14.   42   │     echo "Скачиваем списки пиров"
  15.   43   │     for jj in ${europe_url} ${america_url}
  16.   44   │     do
  17.   45   │         if $DL "${jj}" >& /dev/null; then
  18.   46   │             echo "OK : ${jj}"
  19.   47   │         else
  20.   48   │             echo "FAIL : ${jj}"
  21.   49   │         fi
  22.   50   │     done
  23.   51   │ }
Tags: BASH yggdrasil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement