#!/bin/bash
# /usr/local/bin/watchget
# http://kahealani.net/posix/bin/watchget
# celeste:crystalfaery 2014-09-08 18:03:40+00:00
# watch our downloads run
echo "======= `/usr/local/bin/now` ======= $0 ======="
echo -n "tail -n 1 -F " >> /tmp/$$.txt
for domain in $(ps -ef --forest | grep wg[e]t | grep -v " sed " | sed 's/https:\/\/// ; s/http:\/\/// ; s/^.* // ; s/\/.*$//' | sort -u)
do
if [ -r /home/downloads/$domain/.wget.txt ]
then
echo -n "/home/downloads/$domain/.wget.txt " >> /tmp/$$.txt
else
echo "`/usr/local/bin/now` $0: /home/downloads/$domain/.wget.txt not readable." 1>&2
fi
done
for f in $(cat /home/`whoami`/.monitor.txt)
do
echo -n "$f " >> /tmp/$$.txt
done
`cat /tmp/$$.txt`
syntax highlighted by Code2HTML, v. 0.9.1