-
Notifications
You must be signed in to change notification settings - Fork 5
/
signieren.sh
47 lines (38 loc) · 1.49 KB
/
signieren.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
#!/bin/sh
# benötigt:
# - sshfs
# - ecdsautils (https://github.com/tcatm/ecdsautils)
# - sign.sh und sigtest.sh aus dem Gluon Repo (https://github.com/freifunk-gluon/gluon/tree/master/contrib)
PUBLIC_SIG_KEY='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
PATH_TO_SECRET_SIG_KEY='/root/secret'
FIRMWARESERVER_HOST='[email protected]'
FIRMWARESERVER_PORT='22'
FIRMWARESERVER_MOUNTPOINT='/media/firmware'
read -p "Version?: " VERSION
read -p "Branches? [alle]: " BRANCHES
read -p "Domänen? [alle]: " DOMAENEN
if [ "$DOMAENEN" = "" ] ; then
DOMAENEN="$(seq -w 01 05) $(seq -w 07 76)"
fi
if [ "$BRANCHES" = "" ] ; then
BRANCHES='experimental beta stable'
fi
mkdir -p $FIRMWARESERVER_MOUNTPOINT
sshfs -p $FIRMWARESERVER_PORT $FIRMWARESERVER_HOST:/ $FIRMWARESERVER_MOUNTPOINT
for b in $BRANCHES
do
for i in $DOMAENEN
do
sign.sh $PATH_TO_SECRET_SIG_KEY $FIRMWARESERVER_MOUNTPOINT/var/www/html/domaene"$i"/versions/v"$VERSION"/sysupgrade/"$b".manifest
sigtest.sh $PUBLIC_SIG_KEY $FIRMWARESERVER_MOUNTPOINT/var/www/html/domaene"$i"/versions/v"$VERSION"/sysupgrade/"$b".manifest
RESULT=$?
if [ $RESULT -eq 1 ] ; then
echo "Signieren von Version $VERSION $b für Domäne-$i fehlgeschlagen!";
elif [ $RESULT -eq 0 ] ; then
echo "Signieren von Version $VERSION $b für Domäne-$i erfolgreich!";
else
echo "Signieren von Version $VERSION $b für Domäne-$i fehlgeschlagen mit Fehlercode $? !";
fi
done
done
fusermount -u $FIRMWARESERVER_MOUNTPOINT