daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Aug 16th, 2018 45 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. #! /bin/bash
  2.  
  3. function checkserv {
  4.         rawserv=$((echo -ne '\xFE' ; sleep 1) | nc $1.mc-hg.com 25565 | cut -b4-)
  5.         if [[ "$rawserv" = "" ]] ; then
  6.                 echo -e "\e[1;34m$1.mc-hg.com : QUEUED\e[00m"
  7.         else
  8.                 motd=$(echo "$rawserv" | awk -F'\xa7' {'print $1'})
  9.                 current=$(echo "$rawserv" | awk -F'\xa7' {'print $2'})
  10.                 max=$(echo "$rawserv" | awk -F'\xa7' {'print $3'})
  11.                 timeleft=$(echo "$motd" | awk {'print $3'})
  12.                 if [[ "$(echo $motd | grep -oE 'In progress')" = "In progress" ]] ; then
  13.                         echo -e "\e[0;31m$1.mc-hg.com : $current LEFT IN-GAME\e[00m"
  14.                 elif [[ "$(echo $motd | grep -oE 'minutes')" = "minutes" ]] ; then
  15.                         if [[ $((max-current)) -le 0 ]] ; then
  16.                                 echo -e "\e[0;33m$1.mc-hg.com : FULL - $timeleft min until start - $current players\e[00m"
  17.                         else
  18.                                 echo -e "\e[1;32m$1.mc-hg.com : AVAILABLE - $timeleft min until start - $((max-current)) free slots\e[00m"
  19.                         fi
  20.                 else
  21.                         if [[ $((max-current)) -le 0 ]] ; then
  22.                                 echo -e "\e[0;33m$1.mc-hg.com : FULL - $timeleft sec until start - $current players\e[00m"
  23.                         else
  24.                                 echo -e "\e[1;32m$1.mc-hg.com : AVAILABLE - $timeleft sec until start - $((max-current)) free slots\e[00m"
  25.                         fi
  26.                 fi
  27.         fi
  28. }
  29.  
  30. if [[ "$1" != "" ]] ; then
  31.     checkserv "$1"
  32. else
  33.     for i in {a..e} ; do
  34.         for j in {1..8} ; do
  35.             (checkserv "$i$j") &
  36.         done
  37.     done
  38.     sleep 3
  39.     killall $(basename $0)
  40. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top