-
Notifications
You must be signed in to change notification settings - Fork 16
/
linux.sh
executable file
·77 lines (68 loc) · 1.69 KB
/
linux.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
OLD="https:\/\/cdnjs.cloudflare.com\/ajax"
NEW="unauthenticated"
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/libs $TGDIR/unauthenticated
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
cp module.info $TGDIR
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/$OLD/$NEW/g" -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
FILES="unauthenticated/js/*.min.js"
for f in $FILES
do
if [ -f $f -a -r $f ]; then
sed "s/$OLD/$NEW/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 version $VERSION"
cd $DISTR
# tar -zcf filemin-$VERSION.linux.wbm.gz filemin
tar -zcf filemin-$VERSION.linux.full.wbm.gz filemin
cd ../
perl makemoduledeb.pl --target-dir $DISTR $TGDIR
rm -rf $TGDIR