mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-02-28 01:27:41 +01:00
Updated: audit.sh
This commit is contained in:
parent
3a1427c5d0
commit
f420ac8d43
@ -96,6 +96,7 @@ USE_TOR=false
|
|||||||
CHECK="ALL"
|
CHECK="ALL"
|
||||||
REPLACE=false
|
REPLACE=false
|
||||||
CREATE_THIRD_PARTY_FILE=false
|
CREATE_THIRD_PARTY_FILE=false
|
||||||
|
ONLY_THIRD_PARTY=false
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
@ -129,6 +130,7 @@ function help() {
|
|||||||
echo -e " -l List all resources"
|
echo -e " -l List all resources"
|
||||||
echo -e " -d Check only ONE resource, e.g. jquery"
|
echo -e " -d Check only ONE resource, e.g. jquery"
|
||||||
echo -e " 'bash audit.sh -d jquery'"
|
echo -e " 'bash audit.sh -d jquery'"
|
||||||
|
echo -e " -u Generate URLs only and create THIRD_PARTY.txt"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,6 +290,11 @@ function check_resource() {
|
|||||||
# Get URL of CDN
|
# Get URL of CDN
|
||||||
create_url
|
create_url
|
||||||
|
|
||||||
|
if [ "$ONLY_THIRD_PARTY" = true ]; then
|
||||||
|
third_party+=("${url}")
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Random sleep if the CDN rejects connections (DoS)
|
# Random sleep if the CDN rejects connections (DoS)
|
||||||
# sleep 0.1s - 0.9s per request
|
# sleep 0.1s - 0.9s per request
|
||||||
# sleep 0.$(( (RANDOM % 10) + 1 ))s
|
# sleep 0.$(( (RANDOM % 10) + 1 ))s
|
||||||
@ -591,7 +598,7 @@ function create_url() {
|
|||||||
pre_check
|
pre_check
|
||||||
|
|
||||||
# Handle arguments
|
# Handle arguments
|
||||||
while getopts d:fhlrt opt; do
|
while getopts d:fhlrtu opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
d) CHECK="$OPTARG";;
|
d) CHECK="$OPTARG";;
|
||||||
f) CREATE_THIRD_PARTY_FILE=true;;
|
f) CREATE_THIRD_PARTY_FILE=true;;
|
||||||
@ -599,6 +606,7 @@ while getopts d:fhlrt opt; do
|
|||||||
l) list_resources;;
|
l) list_resources;;
|
||||||
r) REPLACE=true;;
|
r) REPLACE=true;;
|
||||||
t) USE_TOR=true;;
|
t) USE_TOR=true;;
|
||||||
|
u) ONLY_THIRD_PARTY=true && CREATE_THIRD_PARTY_FILE=true;;
|
||||||
?) help;;
|
?) help;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user