Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Version 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftCreatR committed Sep 18, 2020
1 parent 496206d commit 7d17cf8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
vendor/
composer.lock
warp-up.log
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

<div align="center">

![Screenshot](https://raw.githubusercontent.com/SoftCreatR/warp-up/main/warp-up.png)

<a href="#about"> About</a> •
<a href="#disclaimer"> Disclaimer</a> •
<a href="#compatibility"> Compatibility</a> •
Expand Down Expand Up @@ -72,6 +74,7 @@ In fact, Warp-Up should work flawlessly on every system with Bash 5, Curl and jq
* Ubuntu 18.04 LTS (__Bionic__ Beaver)
* Debian 10 (__Buster__)
* Raspbian 10 (__Buster__)
* Windows 10 20H2

#### Also compatible

Expand Down Expand Up @@ -127,7 +130,7 @@ Currently available build options are

#### Additional notes

* You may want to execute Warp-Up on your dedicated server or VPS. Please note, that many IP addresses and ranges are blocked by Cloudflare (e.g. Hetzner) thus they're unable to connect to the cloudflareclient.com API. Instead, you should run Warp-Up on your local machine (on Windows, set up [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/install-win10)).
* You may want to execute Warp-Up on your dedicated server or VPS. Please note, that many IP addresses and ranges are blocked by Cloudflare (e.g. Hetzner) thus they're unable to connect to the cloudflareclient.com API. Instead, you should run Warp-Up on your local machine.

* API requests are limited and may result in error responses. In this case, make sure, that you increase the interval option when running Warp-Up or omit the `--interval` argument to use the default value of 20 seconds.

Expand Down
Binary file added warp-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 36 additions & 11 deletions warp-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# for Cloudflare WARP. #
# #
# Author : Sascha Greuel <[email protected]> #
# Date : 2020-09-18 00:55 #
# Date : 2020-09-18 06:39 #
# License : MIT #
# Version : 1.0.1 #
# Version : 1.1.0 #
# #
# Usage : bash warp-up.sh #
##############################################################
Expand All @@ -21,7 +21,7 @@ command_exists() {
command -v "$@" >/dev/null 2>&1
}

required_packages="curl jq"
required_packages="curl"

for package in $required_packages; do
if ! command_exists "$package"; then
Expand Down Expand Up @@ -156,18 +156,19 @@ fi
##################

warpUp() {
sleep $INTERVAL

# Travis should never make API calls
if [ -n "$TRAVIS_BUILD" ]; then
if [ "$((1 + RANDOM % (1 + 10 - 1)))" -lt 5 ]; then
SUCCESS=$((SUCCESS + 1))
else
FAILURE=$((FAILURE + 1))
fi

sleep $INTERVAL

return
fi

API_URL="https://api.cloudflareclient.com/v0a$((100 + RANDOM % (1 + 999 - 100)))/reg"
INSTALL_ID=$(rnd 22)
BODY="$(
Expand Down Expand Up @@ -198,17 +199,17 @@ warpUp() {
--silent \
"$API_URL"
)

if [ "$(json_val "$API_RESPONSE" referrer)" = "$REFERRER" ]; then
SUCCESS=$((SUCCESS + 1))

echo "$(date): Success"
else
FAILURE=$((FAILURE + 1))

echo "$(date): $API_RESPONSE"
fi

echo "$API_RESPONSE"
} >>"$LOG_FILE" 2>&1

sleep $INTERVAL
}

#######
Expand Down Expand Up @@ -328,6 +329,25 @@ echo " Generation Process"
echo " ##################"
echo ""

# Begin new log entry
HASH=$(date '+%N' | sha1sum | head -c 40)
START=$(date)
END=$(date --date="+$((ITERATIONS * INTERVAL)) seconds")

cat << FOE >> $LOG_FILE
<<<<<<<<${HASH}<<<<
Warp-Up Version : ${WARP_UP_VER}
Warp ID : ${REFERRER}
Iterations : ${ITERATIONS}
Interval : ${INTERVAL}
Process Start : ${START}
Process End (est) : ${END}
======
FOE

echo -ne ' Generating extra traffic [..]\r'

if [ "$ITERATIONS" -lt 1 ]; then
Expand All @@ -344,6 +364,11 @@ else
done
fi

cat << FOE >> $LOG_FILE
<<<<
FOE

echo ""
echo ""
echo -e "${CGREEN} Done! ${CEND}${CBLUE}$SUCCESS GB${CEND}${CGREEN} extra traffic have been added to your WARP account.${CEND}"
Expand Down

0 comments on commit 7d17cf8

Please sign in to comment.