2019-11-09 01:29:29 +03:00
|
|
|
#!/bin/bash
|
|
|
|
##########
|
|
|
|
# (actually main) script which cron (systemd.timer) starts by time
|
|
|
|
##########
|
2020-03-21 09:33:16 +03:00
|
|
|
full_path=$(dirname "$(realpath $0)")
|
|
|
|
source /opt/downloader/config_list.sh
|
2019-11-09 01:29:29 +03:00
|
|
|
|
|
|
|
for i in $list; do
|
|
|
|
echo "$i is live?..."
|
|
|
|
|
|
|
|
#check folder
|
2020-03-21 09:33:16 +03:00
|
|
|
[ ! -d $storage_path/$i ] && mkdir -p $storage_path/$i && echo "Created dir $storage_path/$i"
|
2019-11-09 01:29:29 +03:00
|
|
|
|
|
|
|
#detached check & start
|
2020-03-21 09:33:16 +03:00
|
|
|
screen -dmS $i bash $full_path/check.sh $i
|
|
|
|
sleep 2
|
2019-11-09 01:29:29 +03:00
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
#Show status
|
|
|
|
echo "===="
|
|
|
|
|
|
|
|
for i in $list; do
|
2020-03-21 09:33:16 +03:00
|
|
|
[ -f $storage_path/$i/pid] && echo $i "is recording!" || echo $i "is not recording"
|
2019-11-09 01:29:29 +03:00
|
|
|
done
|
|
|
|
echo "===="
|