-
Notifications
You must be signed in to change notification settings - Fork 5
/
manifestdateienerzeugen.sh
executable file
·67 lines (62 loc) · 2.53 KB
/
manifestdateienerzeugen.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
#!/bin/bash
PRIORITY=0
if [ "$1" == "" ]; then
echo "fehlender parameter Pfad"
exit 0
fi
cd "$1"
datum='2022-01-01 14:24:59+00:00'
for i in stable beta experimental; do
echo "BRANCH=$i" > $i.manifest
echo "DATE=$datum" >> $i.manifest
echo "PRIORITY=$PRIORITY" >> $i.manifest
echo >> $i.manifest
for j in *bin; do
model=${j#*-*-*-*}
model=${model%-sysupgrade.bin}
version=${j#*-*-}
version=${version%-$model-sysupgrade.bin}
pruefsumme256file=`sha256sum $j|sed -e 's/ / /g'`
pruefsumme512file=`sha512sum $j|sed -e 's/ / /g'`
pruefsumme256=`sha256sum $j|sed -e 's/ .*//'`
pruefsumme512=`sha512sum $j|sed -e 's/ .*//'`
originalFile=$(readlink -f $j)
fileSize=$(stat -c %s "$originalFile")
echo "$model $version $pruefsumme256 $fileSize $j" >> $i.manifest
echo "$model $version $pruefsumme256 $j" >> $i.manifest
echo "$model $version $pruefsumme512 $j" >> $i.manifest
echo "$i $model $version"
done
for j in *tar; do
model=${j#*-*-*-*}
model=${model%-sysupgrade.tar}
version=${j#*-*-}
version=${version%-$model-sysupgrade.tar}
pruefsumme256file=`sha256sum $j|sed -e 's/ / /g'`
pruefsumme512file=`sha512sum $j|sed -e 's/ / /g'`
pruefsumme256=`sha256sum $j|sed -e 's/ .*//'`
pruefsumme512=`sha512sum $j|sed -e 's/ .*//'`
originalFile=$(readlink -f $j)
fileSize=$(stat -c %s "$originalFile")
echo "$model $version $pruefsumme256 $fileSize $j" >> $i.manifest
echo "$model $version $pruefsumme256" >> $i.manifest
echo "$model $version $pruefsumme512" >> $i.manifest
echo "$i $model $version"
done
for j in *img.gz; do
model=${j#*-*-*-*}
model=${model%-sysupgrade.img.gz}
version=${j#*-*-}
version=${version%-$model-sysupgrade.img.gz}
pruefsumme256file=`sha256sum $j|sed -e 's/ / /g'`
pruefsumme512file=`sha512sum $j|sed -e 's/ / /g'`
pruefsumme256=`sha256sum $j|sed -e 's/ .*//'`
pruefsumme512=`sha512sum $j|sed -e 's/ .*//'`
originalFile=$(readlink -f $j)
fileSize=$(stat -c %s "$originalFile")
echo "$model $version $pruefsumme256 $fileSize $j" >> $i.manifest
echo "$model $version $pruefsumme256" >> $i.manifest
echo "$model $version $pruefsumme512" >> $i.manifest
echo "$i $model $version"
done
done