forked from freifunk-westpfalz/site-ffwp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-manifest.sh
executable file
·88 lines (65 loc) · 2.85 KB
/
make-manifest.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
#!/bin/bash
#Createing manifest file for chosen branch (arg1)
# if version is unset, will use the default nightly version from site.mk
#VERSION=0.5.0
# branch must be set to either nightly, beta or stable
BRANCH=$1
#debug switch: DEBUG=V\=s
#DEBUG=V\=s
DEBUG=
cd ..
if [ ! -d "site" ]; then
echo "This script must be called from within the site directory"
return
fi
LOGFILE=../make-manifest-$BRANCH.log
WWWROOT=/srv/firmware
RESULT=0
rm -f $LOGFILE
date | tee -a $LOGFILE
#echo -e "make GLUON_BRANCH=nightly manifest" >> $LOGFILE
#make GLUON_BRANCH=nightly manifest >> $LOGFILE 2>&1
#echo -e "\n\n\n============================================================\n\n" >> $LOGFILE
if [[ "$BRANCH" == "beta" ]]
then
#echo -e "make GLUON_BRANCH=beta manifest" >> $LOGFILE
#make GLUON_BRANCH=beta manifest >> $LOGFILE 2>&1
echo -e "create $BRANCH.manifest" >> $LOGFILE
echo BRANCH=beta > $WWWROOT/.pre_$BRANCH/sysupgrade/$BRANCH.manifest
date +DATE=%F\ %T%:z >> $WWWROOT/.pre_$BRANCH/sysupgrade/$BRANCH.manifest
awk '{if ((NR > 2)) print $0}' $WWWROOT/.pre_$BRANCH/sysupgrade/.template.manifest >> $WWWROOT/.pre_$BRANCH/sysupgrade/$BRANCH.manifest
echo -e "\n\n\n============================================================\n\n" >> $LOGFILE
fi
if [[ "$BRANCH" == "stable" ]]
then
#echo -e "make GLUON_BRANCH=stable manifest" >> $LOGFILE
#make GLUON_BRANCH=stable manifest >> $LOGFILE 2>&1
echo -e "create $BRANCH.manifest" >> $LOGFILE
echo BRANCH=stable > $WWWROOT/.pre_$BRANCH/sysupgrade/$BRANCH.manifest
date +DATE=%F\ %T%:z >> $WWWROOT/.pre_$BRANCH/sysupgrade/$BRANCH.manifest
awk '{if ((NR > 2)) print $0}' $WWWROOT/.pre_$BRANCH/sysupgrade/.template.manifest >> $WWWROOT/.pre_$BRANCH/sysupgrade/$BRANCH.manifest
echo -e "\n\n\n============================================================\n\n" >> $LOGFILE
fi
echo "Manifest creation complete, no auto-signing for branch $BRANCH" | tee -a $LOGFILE
#echo -e "contrib/sign.sh ../ecdsa-key-secret output/images/sysupgrade/nightly.manifest" >> $LOGFILE
#contrib/sign.sh ../ecdsa-key-secret output/images/sysupgrade/nightly.manifest >> $LOGFILE 2>&1
#if [[ "$BRANCH" == "beta" ]] || [[ "$BRANCH" == "stable" ]]
#then
# echo -e "contrib/sign.sh ../ecdsa-key-secret output/images/sysupgrade/beta.manifest" >> $LOGFILE
# contrib/sign.sh ../ecdsa-key-secret output/images/sysupgrade/beta.manifest >> $LOGFILE 2>&1
#fi
#if [[ "$BRANCH" == "stable" ]]
#then
# echo -e "contrib/sign.sh ../ecdsa-key-secret output/images/sysupgrade/stable.manifest" >> $LOGFILE
# contrib/sign.sh ../ecdsa-key-secret output/images/sysupgrade/stable.manifest >> $LOGFILE 2>&1
#fi
#echo -e "--- md5 erzeugen ---" >> $LOGFILE
#cd output/images/factory
#md5sum gluon* > md5.txt
#cd ../sysupgrade
#md5sum gluon* > md5.txt
#cd ../../../
date >> $LOGFILE
echo "Done :) $RESULT error/s"| tee -a $LOGFILE
cd site
exit 0