iincognito15
New Member
I found this bash script in the ask ubuntu forum and it works, but I would like to know if it can be used or improved to know if a tiktok stream is live or off, using the bash script via terminal (./test.url.sh /url.txt) in the .txt would be the tiktok addresses for example:
and that in the terminal tell me if it is live or off, is it possible?
#!/bin/bash
if [ $# -eq 0 ]
then
fin=-
else
fin=$1
fi
urlarr=( $(cat $fin | strings | grep '://' | grep -i "\.com\|\.net\|\.edu\|\.org\|[0-9].*\.[0-9].*\.[0-9].*\.[0-9].*" | tr '\n' ' ' ) )
for i in ${urlarr[@]}
do
if wget -q --tries=1 --no-cache --spider -O /dev/null --ignore-length -T 1 "$i"
then
echo $i is good.
else
echo $i is bad.
fi
done
exit $?
and that in the terminal tell me if it is live or off, is it possible?
#!/bin/bash
if [ $# -eq 0 ]
then
fin=-
else
fin=$1
fi
urlarr=( $(cat $fin | strings | grep '://' | grep -i "\.com\|\.net\|\.edu\|\.org\|[0-9].*\.[0-9].*\.[0-9].*\.[0-9].*" | tr '\n' ' ' ) )
for i in ${urlarr[@]}
do
if wget -q --tries=1 --no-cache --spider -O /dev/null --ignore-length -T 1 "$i"
then
echo $i is good.
else
echo $i is bad.
fi
done
exit $?