summaryrefslogtreecommitdiffstats
path: root/bin/get-comics
blob: 472344d699429720e14621df73d651801a159f48 (plain)
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
#!/bin/sh

if [ "$1" = "--output" ]; then
	output=true
	shift
fi

if [ "$1" = "" ]; then
	daysago=0
else
	daysago=$1
fi

top="$( cd "$(dirname "$0")/../" >/dev/null 2>&1 && pwd )"
for update in ${top}/bin/comics/* ; do

	comic=$(basename $update)
	if [ "$output" = "true" ]; then
		${update} "${top}" "${daysago}" &
	else
                myDate=$(date -Im --date "$daysago days ago")
		echo "---------------- $myDate ----------------" >> ${top}/log/${comic}.log
		${update} "${top}" "${daysago}" >> ${top}/log/${comic}.log 2>&1 &
	fi

	sleep 2
done