-
Notifications
You must be signed in to change notification settings - Fork 16
/
linux.cdn.sh
executable file
·62 lines (55 loc) · 1.4 KB
/
linux.cdn.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
59
60
61
62
#!/bin/sh
FILES="*.cgi"
TGDIR="./upload/filemin"
DISTR="./upload"
mkdir -p $TGDIR
mkdir -p $TGDIR/unauthenticated
mkdir -p $TGDIR/unauthenticated/js
mkdir -p $TGDIR/unauthenticated/css
mkdir -p $TGDIR/unauthenticated/templates
cp -R images $TGDIR
cp -R lang $TGDIR
cp -R lib $TGDIR
cp -R unauthenticated/js/*.min.js $TGDIR/unauthenticated/js
cp -R unauthenticated/css/*.min.css $TGDIR/unauthenticated/css
cp filemin-updater.tar.gz $TGDIR/unauthenticated
cp CHANGELOG.md $TGDIR
cp LICENCE $TGDIR
cp README.md $TGDIR
cp acl_security.pl $TGDIR
# cp postinstall.pl $TGDIR
# cp uninstall.pl $TGDIR
cp config $TGDIR
cp config.info $TGDIR
cp defaultacl $TGDIR
cp filemin-lib.pl $TGDIR
sed -e "s/flavour=full/flavour=cdn/g" "module.info" > "$TGDIR/module.info"
for f in $FILES
do
if [ -f $f -a -r $f ]; then
cp $f "$TGDIR/$f"
else
echo "Error: Cannot read $f"
fi
done
FILES="unauthenticated/templates/*.html"
for f in $FILES
do
if [ -f $f -a -r $f ]; then
sed -e "s/filemin\./filemin\.min\./g" -e "s/chmod-calculator\./chmod-calculator\.min\./g" -e "s/spec-ops\./spec-ops\.min\./g" "$f" > "$TGDIR/$f"
else
echo "Error: Cannot read $f"
fi
done
while IFS='=' read -r key value; do
case $key in
version)
VERSION="$value"
;;
esac
done < module.info
echo "Packing Linux CDN version $VERSION"
cd $DISTR
tar -zcf filemin-$VERSION.linux.cdn.wbm.gz filemin
cd ../
rm -rf $TGDIR