diff options
-rwxr-xr-x | tmw-info.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tmw-info.sh b/tmw-info.sh index e4e7a04..a9dcfa2 100755 --- a/tmw-info.sh +++ b/tmw-info.sh @@ -101,8 +101,8 @@ if [ "$1" == "help" ] || [ "$1" == "--help" ] || [ "$1" == "-h" ]; then elif [ "$1" == "news" ]; then curl -s 'https://themanaworld.github.io/tmwa-server-data/news.html' | sed 's/<\/*[^>]*>//g' | less elif [ "$1" == "online" ]; then - #curl -s 'https://server.themanaworld.org/' | sed 's/<\/*[^>]*>//g' | sed -r '/^\s*$/d' | sed -r '/^\s*Name\s*$/d' | sed 1d - curl -s 'https://server.themanaworld.org/' | sed 's/<\/*[^>]*>//g' | sed -r '/^\s*$/d' | sed -r '/^\s*Name\s*$/d' | grep -v 'Online Players' | sed 1d | LC_ALL=C sort + #wget -q 'https://server.themanaworld.org/' | sed 's/<\/*[^>]*>//g' | sed -r '/^\s*$/d' | sed -r '/^\s*Name\s*$/d' | sed 1d + wget -q 'https://server.themanaworld.org/' | sed 's/<\/*[^>]*>//g' | sed -r '/^\s*$/d' | sed -r '/^\s*Name\s*$/d' | grep -v 'Online Players' | sed 1d | LC_ALL=C sort elif [ "$1" == "gm-update" ]; then mkdir -p "$TMW_GM_LOGS" # Get list of files from server to read the byte counts from @@ -201,7 +201,7 @@ elif [ "$1" == 'gm-show' ]; then # Maximum number of new lines to report LINE_COUNT='10' # Download the GM log - curl -s "$GM_LOG_URL$LOG_DATE" > "$GM_LOG" + wget -q "$GM_LOG_URL$LOG_DATE" > "$GM_LOG" # Check if no posts made this month yet if [[ $(grep '<head><title>404 Not Found</title></head>' "$GM_LOG") != '' ]]; then LINE_COUNT_TODAY='0' @@ -227,12 +227,12 @@ elif [ "$1" == 'gm-show' ]; then LINE_COUNT_YESTERDAY=$(( "$LINE_COUNT" - "$LINE_COUNT_TODAY" )) # Make sure it isn't January, download last month's log and append lines to file if [[ $(date -u +%m) != '01' ]]; then - curl -s "$GM_LOG_URL$(date -u +%Y)-$LAST_MONTH" > "$GM_LOG"'_last_month' + wget -q "$GM_LOG_URL$(date -u +%Y)-$LAST_MONTH" > "$GM_LOG"'_last_month' grep "$(date -u +%Y)-$LAST_MONTH-$YESTERDAY" "$GM_LOG"'_last_month' | tail -n "$LINE_COUNT_YESTERDAY" > "$GM_REPORT" grep "$LOG_DATE-$TODAY" "$GM_LOG" >> "$GM_REPORT" # If it is January, last month is also last year else - curl -s "$GM_LOG_URL$LAST_YEAR-12" > "$GM_LOG"'_last_month' + wget -q "$GM_LOG_URL$LAST_YEAR-12" > "$GM_LOG"'_last_month' grep "$LAST_YEAR-12-31" "$GM_LOG"'_last_month' | tail -n "$LINE_COUNT_YESTERDAY" > "$GM_REPORT" grep "$LOG_DATE-$TODAY" "$GM_LOG" >> "$GM_REPORT" fi @@ -274,10 +274,10 @@ elif [ "$1" == "chat-search" ]; then fi elif [ "$1" == 'item-update' ]; then mkdir -p "$ITEM_DIR" - ITEM_FILES=($(curl -s 'https://github.com/themanaworld/tmwa-server-data/tree/master/world/map/db' | sed 's/<\/*[^>]*>//g' | grep -o 'item_db.*\.txt')) + ITEM_FILES=($(wget -q 'https://github.com/themanaworld/tmwa-server-data/tree/master/world/map/db' | sed 's/<\/*[^>]*>//g' | grep -o 'item_db.*\.txt')) for ITEM_FILE in "${ITEM_FILES[@]}"; do echo "Downloading $ITEM_FILE" - curl -s "https://github.com/themanaworld/tmwa-server-data/blob/master/world/map/db/$ITEM_FILE"\ + wget -q "https://github.com/themanaworld/tmwa-server-data/blob/master/world/map/db/$ITEM_FILE"\ | grep -Eo '[0-9]+,\s*[a-zA-Z0-9]+,\s*[0-9]+,\s*[0-9]+,.*$|//ID,\s*Name.*$' | sed -E 's/<\/td>//g' | sed 's/"//g'\ | sort -nu > "$ITEM_DIR/$ITEM_FILE" done @@ -314,10 +314,10 @@ $(echo "$LINE" | grep -o '{.*}' | sed 's/[,{}]//g' | sed 's/^\s*//g')\n" done < "$TMW_INFO/item-search$LAST_COUNT.tmp" elif [ "$1" == 'mob-update' ]; then mkdir -p "$MOB_DIR" - MOB_FILES="$(curl -s 'https://github.com/themanaworld/tmwa-server-data/tree/master/world/map/db' | sed 's/<\/*[^>]*>//g' | grep -o 'mob_db.*\.txt')" + MOB_FILES="$(wget -q 'https://github.com/themanaworld/tmwa-server-data/tree/master/world/map/db' | sed 's/<\/*[^>]*>//g' | grep -o 'mob_db.*\.txt')" for MOB_FILE in $MOB_FILES; do echo "Downloading $MOB_FILE" - curl -s "https://github.com/themanaworld/tmwa-server-data/blob/master/world/map/db/$MOB_FILE" \ + wget -q "https://github.com/themanaworld/tmwa-server-data/blob/master/world/map/db/$MOB_FILE" \ | grep -Eo '[0-9]+,\s*[a-zA-Z0-9]+,\s*[a-zA-Z0-9]+,\s*[0-9]+,.*$|//ID,\s*Name.*$' | sed -E 's/<\/td>//g' | sed 's/"//g' \ | sort -nu > "$MOB_DIR/$MOB_FILE" done |