-
Notifications
You must be signed in to change notification settings - Fork 75
/
build.sh
executable file
·59 lines (49 loc) · 1.37 KB
/
build.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
#!/bin/sh
set -e
cd $(dirname $0)
. wyze_hack/hack_ver.inc
echo "Building release $WYZEHACK_VER ..."
RELEASE=`echo "$WYZEHACK_VER"|tr '.' '_'`
rm ./release/wyze_hacks_$RELEASE.zip 2>/dev/null || true
mkdir -p .tmp/Upgrade
echo FWGRADEUP=app > .tmp/Upgrade/PARA
sed "s/__WYZEHACK_VER__/$WYZEHACK_VER/g" ./wyze_hack/stub.sh > .tmp/Upgrade/wyze_hack.sh
tar \
--sort=name \
--owner=root:0 \
--group=root:0 \
--mtime='1970-01-01' \
--dereference \
-cz -O -C wyze_hack \
./main.sh \
./hack_ver.inc \
./bin \
>>.tmp/Upgrade/wyze_hack.sh
chmod a+x .tmp/Upgrade/wyze_hack.sh
cp -r \
./wyze_hack/upgraderun.sh \
./wyze_hack/upgrade.sh \
./wyze_hack/install_snd \
./wyze_hack/rootfs \
.tmp/Upgrade/
tar \
--sort=name \
--owner=root:0 \
--group=root:0 \
--mtime='1970-01-01' \
--dereference -cf ./installer/FIRMWARE_660R.bin -C ./.tmp Upgrade
rm -rf .tmp
MD5=`md5sum ./installer/FIRMWARE_660R.bin | grep -oE "^[0-9a-f]*"`
cat > ./installer/version.ini << EOL
[SD]
version=9.9.9.9
type=1
md5=$MD5
EOL
zip -r -j ./release/wyze_hacks_$RELEASE.zip ./installer -x *.inc *.tokens @
rm -rf ./release/release_$RELEASE
unzip -q ./release/wyze_hacks_$RELEASE.zip -d ./release/release_$RELEASE
if [ -f ./installer/config.inc ];then
cp ./installer/config.inc ./release/release_$RELEASE
fi
echo "Release $WYZEHACK_VER build finished."