-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMass.sh
41 lines (34 loc) · 1.01 KB
/
Mass.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Menyimpan argumen dalam variabel
file_to_upload="$1"
url_list="$2"
# Memeriksa apakah argumen telah diberikan
if [ -z "$file_to_upload" ] || [ -z "$url_list" ]; then
echo "https://www.msverse.site/"
echo "Usage: ./cURL.sh <file_to_upload> <url_list>"
exit 1
fi
# Memeriksa keberadaan file yang akan diunggah
if [ ! -f "$file_to_upload" ]; then
echo "File '$file_to_upload' tidak ditemukan."
exit 1
fi
# Memeriksa keberadaan file daftar URL
if [ ! -f "$url_list" ]; then
echo "File '$url_list' tidak ditemukan."
exit 1
fi
# Mengunggah file ke setiap URL secara paralel (maksimum 4 proses)
cat "$url_list" | xargs -P 4 -I {} bash -c '
url="$1"
file="$2"
# Mengunggah file ke URL menggunakan curl
result=$(curl --max-time 10 --write-out "%{http_code}\n" --silent --output /dev/null -T "$file" "$url")
if [ $result -eq 201 ] || [ $result -eq 204 ] || [ $result -eq 200 ]; then
echo "[+] $url => OK"
echo ""
else
echo "[+] $url => ERROR"
echo ""
fi
' _ {} "$file_to_upload"