summaryrefslogtreecommitdiff
path: root/user-pages-download.sh
blob: 56f2fec61a86a87e3a7e7ff5bd63e205eeede945 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

rm -rf user-pages.cache.bak
mkdir -p user-pages.cache
mv user-pages.cache user-pages.cache.bak
mkdir user-pages.cache

./user-pages-list.rb |
while read -r title; do
	if ! [[ -f "user-pages.cache/$title" ]]; then
		if [[ -f "user-pages.cache.bak/$title" ]]; then
			cp -v "user-pages.cache.bak/$title" "user-pages.cache/$title"
		else
			wget -O "user-pages.cache/$title" "https://wiki.parabolagnulinux.org/index.php?title=${title}&action=raw"
		fi
	fi
done