Improved update script
This commit is contained in:
parent
cbdf3860b0
commit
7ffb187c54
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user