-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgenerateUrls.sh
32 lines (25 loc) · 996 Bytes
/
generateUrls.sh
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
28
29
30
31
#!/bin/bash
output=src/statics/edu.nd
url_re='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]\.[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
# rel_re='[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]\.[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
regex1="^.*url\([\'\"]{0,1}($url_re)[\'\"]{0,1}\).*$"
# regex2="^.*url\([\'\"]{0,1}(\/$rel_re)[\'\"]{0,1}\).*"
wget --mirror -P "${output}" https://conductor.nd.edu/stylesheets/themes/ndt/v3/ndt.css
while read line
do
if [[ $line =~ $regex1 ]]
then
# echo ${BASH_REMATCH[1]} $line
wget -q --mirror -P "${output}" "${BASH_REMATCH[1]}"
fi
# if [[ $line =~ $regex2 ]]
# then
# wget --mirror -P src/statics/edu.nd/conductor.nd.edu "https://conductor.nd.edu${BASH_REMATCH[1]}"
# fi
done < "./src/statics/edu.nd/conductor.nd.edu/stylesheets/themes/ndt/v3/ndt.css"
# Replace
# url('/
# url('/statics/edu.nd/conductor.nd.edu/
# Replace
# url('https://
# url('/statics/edu.nd/