This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
496206d
commit 7d17cf8
Showing
4 changed files
with
41 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea | ||
vendor/ | ||
composer.lock | ||
warp-up.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 # | ||
############################################################## | ||
|
@@ -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 | ||
|
@@ -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="$( | ||
|
@@ -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 | ||
} | ||
|
||
####### | ||
|
@@ -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 | ||
|
@@ -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}" | ||
|