mirror of
https://github.com/adrlau/random-scripts.git
synced 2024-12-21 11:27:30 +01:00
24 lines
433 B
Bash
24 lines
433 B
Bash
|
#used by me for basic network and api resillient testing
|
||
|
|
||
|
#take inputs
|
||
|
echo "Enter the url to curl: "
|
||
|
read url
|
||
|
echo "Enter the number of times to curl, or 0 for forever: "
|
||
|
read num
|
||
|
echo "Enter the time between curls in seconds: "
|
||
|
read time
|
||
|
|
||
|
#run curl
|
||
|
if [ $num -ne 0 ]; then
|
||
|
for ((i=1;i<=$num;i++))
|
||
|
do
|
||
|
curl $url
|
||
|
sleep $time
|
||
|
done
|
||
|
else
|
||
|
while true
|
||
|
do
|
||
|
curl $url
|
||
|
sleep $time
|
||
|
done
|
||
|
fi
|