forked from ldittmar81/webmatic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_img.sh
executable file
·107 lines (91 loc) · 3.54 KB
/
generate_img.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/sh
echo "BEGINN"
ISALPHA=$(cat ISALPHA)
VERSION=""
STABLEVERSION=""
FOLDER=""
if [ ${ISALPHA} = "0" ]; then
echo "Vollversion"
VERSION=$(cat VERSION)
STABLEVERSION=${VERSION}
FOLDER=webmatic
mkdir -p tmp/${FOLDER}
cp -a VERSION tmp/
mkdir -p tmp/rc.d
cp -a rc.d/webmatic tmp/rc.d/
cp -a update_script tmp/
elif [ ${ISALPHA} = "1" ]; then
echo "Alpha Version"
VERSION=$(cat VERSIONALPHA)
STABLEVERSION=$(cat VERSION)
FOLDER=wmalpha
mkdir -p tmp/${FOLDER}
cp -a VERSIONALPHA tmp/VERSION
mkdir -p tmp/rc.d
cp -a rc.d/wmalpha tmp/rc.d/
cp -a update_script_alpha tmp/update_script
fi
echo "Dateien kopieren"
cp webmatic/*.* tmp/${FOLDER}/
cp -a webmatic/cgi tmp/${FOLDER}/
cp -a webmatic/img tmp/${FOLDER}/
cp -a webmatic/libs tmp/${FOLDER}/
mkdir -p tmp/${FOLDER}/js/i18n
cp -a webmatic/js/*.min.js tmp/${FOLDER}/js/
cp -a webmatic/js/i18n/*.min.js tmp/${FOLDER}/js/i18n/
mkdir -p tmp/${FOLDER}/themes
cp -a webmatic/themes/*.min.* tmp/${FOLDER}/themes/
cp -a webmatic/themes/images tmp/${FOLDER}/themes/
cp -a webmatic/themes/fonts tmp/${FOLDER}/themes/
cp -a ccu1 tmp/
cp -a ccu2 tmp/
cp -a ccurm tmp/
GERDATE=$(date +"%d.%m.%y")
HASHDATE=$(date +"%y%m%d")
cd tmp
echo "Anpassungen an Dateien"
cd ${FOLDER}
sed -i "s/BETAVERSION/${VERSION}/g" index.html
sed -i "s/BETAVERSION/${VERSION}/g" get.html
sed -i "s/BETAVERSION/${VERSION}/g" dlgAbout.html
sed -i "s/BETAVERSION/${VERSION}/g" webmatic.appcache
sed -i "s/RELEASEDATE/${GERDATE}/g" dlgAbout.html
sed -i "s/<html lang=\"de\">/<html lang=\"de\" manifest=\"webmatic.appcache\">/g" index.html
sed -i "s/<html lang=\"de\">/<html lang=\"de\" manifest=\"webmatic.appcache\">/g" get.html
sed -i "s/wmalpha_user/${FOLDER}_user/" index.html
sed -i "s/wmalpha_user/${FOLDER}_user/" get.html
sed -i "s/webmatic.css/webmatic.min.css?${HASHDATE}/" index.html
sed -i "s/webmatic.css/webmatic.min.css?${HASHDATE}/" get.html
sed -i "s/webmatic.css/webmatic.min.css?${HASHDATE}/" dlgAbout.html
sed -i "s/wmmap.de.js/wmmap.de.min.js?${HASHDATE}/" index.html
sed -i "s/wmmap.de.js/wmmap.de.min.js?${HASHDATE}/" get.html
sed -i "s/wmmap.js/wmmap.min.js?${HASHDATE}/" index.html
sed -i "s/wmmap.js/wmmap.min.js?${HASHDATE}/" get.html
sed -i "s/wmhelper.js/wmhelper.min.js?${HASHDATE}/" index.html
sed -i "s/wmhelper.js/wmhelper.min.js?${HASHDATE}/" get.html
sed -i "s/webmatic.js/webmatic.min.js?${HASHDATE}/" index.html
sed -i "s/webmatic.js/webmatic.min.js?${HASHDATE}/" get.html
sed -i "s/options.js/options.min.js?${HASHDATE}/" index.html
sed -i "s/optionsClient.js/optionsClient.min.js?${HASHDATE}/" index.html
sed -i "s/optionsOthers.js/optionsOthers.min.js?${HASHDATE}/" index.html
sed -i "s/optionsRFF.js/optionsRFF.min.js?${HASHDATE}/" index.html
sed -i "s/loadData.js/loadData.min.js?${HASHDATE}/" index.html
sed -i "s/loadData.js/loadData.min.js?${HASHDATE}/" get.html
sed -i "s/init.js/init.min.js?${HASHDATE}/" index.html
sed -i "s/init.js/init.min.js?${HASHDATE}/" get.html
sed -i "s/index.js/index.min.js?${HASHDATE}/" index.html
sed -i "s/get.js/get.min.js?${HASHDATE}/" get.html
cd js
echo "Anpassungen an JavaScript-Dateien"
sed -i "s/webmaticVersion=\"0\"/webmaticVersion=\"${VERSION}\"/" wmhelper.min.js
sed -i "s/lastStableVersion=\"0\"/lastStableVersion=\"${STABLEVERSION}\"/" wmhelper.min.js
sed -i "s/isPreRelease=1/isPreRelease=${ISALPHA}/" wmhelper.min.js
sed -i "s/debugModus=true/debugModus=false/" wmhelper.min.js
cd ..
cd ..
echo "Packen"
tar --owner=root --group=root -czvf ../webmatic-${VERSION}.tar.gz *
cd ..
echo "Temp Dateien löschen"
rm -rf tmp
echo "Ende"