summaryrefslogtreecommitdiffstats
path: root/.local/bin/rechin
blob: b455aa04a0a95a827775b2c37cb903834f8dd826 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

application="gallery-dl"
site="boards.4chan.org"
site_domain="$(echo $site | cut -f2 -d.)"

if [ ! -d "$PWD/$application" ] && [ ! -d "$PWD/$application/$site_domain" ]; then
    echo "Directories to read from are missing, exiting."
    exit 0
fi

for board in $(ls $application/$site_domain/)
do
	for thread in $(ls $application/$site_domain/$board | cut -f1 -d" " | tac)
	do
		$application "https://$site/$board/thread/$thread"
	done
done