-
Notifications
You must be signed in to change notification settings - Fork 58
/
update_new_web
37 lines (33 loc) · 995 Bytes
/
update_new_web
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
(
set -e
mkdir -p new_web
cd new_web
wget -q --save-cookies cookies.txt --load-cookies cookies.txt -N https://github.com/Matasx/mmbot-web-ui/releases/latest/download/release.zip
if [ -e files.sha ] && sha1sum --quiet --status -c files.sha
then
echo new web is already up to date
else
echo updating new web pages
rm -rf files
(
cd ../www;
find -L . -name . -o -type d -prune -o -type l -exec rm {} +
)
mkdir -p files
unzip -qo release.zip -d files
(
cd files
sed -i "s/\"url\": *\"\"/\"url\": \"..\\/\"/" config.json
sed -i "s/\"start_url\": *\".\"/\"start_url\":\"index.html\"/" manifest.json
)
ln -s $PWD/files $PWD/../www/new
sha1sum release.zip > files.sha
echo -----------------------------------------------
echo "A new user interface has been installed"
echo
echo "Test our new user interface. Open \"/new/index.html\" page"
echo
echo "Send feedback to https://discord.gg/Hs9DbsANeV"
echo "Credits to Matasx"
fi
)