Improved update script

This commit is contained in:
Giulio 2020-09-23 19:03:15 +02:00
parent cbdf3860b0
commit 7ffb187c54
3 changed files with 5 additions and 5 deletions

View File

@ -49,8 +49,8 @@ openssl rsa -in target/keys/signingkey.pem -outform PEM -pubout -out target/keys
cp target/keys/signingpub.pem target/overlay/pub.pem
echo "[+] Generating sample update package"
mkdir -p home/update
echo "sample update" > home/update/sample.txt
mkdir -p home/upgrade
echo "sample update" > home/upgrade/sample.txt
tar -cvf update.tar home
openssl dgst -sha256 -sign target/keys/signingkey.pem -out update.tar.sig update.tar
cat update.tar > update.tar.cc

View File

@ -2,8 +2,8 @@ auto lo
iface lo inet loopback
auto eth0
pre-up sleep 10
iface eth0 inet dhcp
pre-up sleep 20
auto ap0
iface ap0 inet static

View File

@ -34,9 +34,9 @@ then
/bin/echo "[+] Signature is valid!"
/bin/echo "[+] Upgrading..."
/bin/tar -xvf $file -C /
/bin/rm $file /tmp/sig
/bin/rm /tmp/sig
/bin/echo "[+] Done"
else
/bin/echo "[-] Signature error, exiting..."
/bin/rm $file /tmp/sig
/bin/rm /tmp/sig
fi