-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate-downloads.sh
executable file
·58 lines (34 loc) · 1.06 KB
/
update-downloads.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash -e
cd $(dirname "$0")
DIR=$(pwd)
. config
COUNTER_EXTENSION='.DOWNLOADS'
for RELEASE in $RELEASES; do
UBUNTU=${RELEASE%%/*}
MINT=${RELEASE#*/}
cd "${UBUNTU}"
cd 'pool'
for version in *; do
if [ ! -d "${version}" ]; then
continue
fi
cd "${version}"
(
for counter in *${COUNTER_EXTENSION}; do
[ "${counter}" == "*${COUNTER_EXTENSION}" ] && continue
filename=${counter%"${COUNTER_EXTENSION}"}
total=0
while read date count; do
((total+=count)) || true
done <${counter}
echo "AddDescription \"Downloads: ${total}\" ${filename}"
done
echo "AddDescription \" \" .."
echo "AddDescription \"Downloads: 0\" *"
) > .htaccess
cd ..
done
cd ..
cd ..
done
exit 0