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
|
cp target/keys/signingpub.pem target/overlay/pub.pem
|
||||||
|
|
||||||
echo "[+] Generating sample update package"
|
echo "[+] Generating sample update package"
|
||||||
mkdir -p home/update
|
mkdir -p home/upgrade
|
||||||
echo "sample update" > home/update/sample.txt
|
echo "sample update" > home/upgrade/sample.txt
|
||||||
tar -cvf update.tar home
|
tar -cvf update.tar home
|
||||||
openssl dgst -sha256 -sign target/keys/signingkey.pem -out update.tar.sig update.tar
|
openssl dgst -sha256 -sign target/keys/signingkey.pem -out update.tar.sig update.tar
|
||||||
cat update.tar > update.tar.cc
|
cat update.tar > update.tar.cc
|
||||||
|
@ -2,8 +2,8 @@ auto lo
|
|||||||
iface lo inet loopback
|
iface lo inet loopback
|
||||||
|
|
||||||
auto eth0
|
auto eth0
|
||||||
pre-up sleep 10
|
|
||||||
iface eth0 inet dhcp
|
iface eth0 inet dhcp
|
||||||
|
pre-up sleep 20
|
||||||
|
|
||||||
auto ap0
|
auto ap0
|
||||||
iface ap0 inet static
|
iface ap0 inet static
|
||||||
|
@ -34,9 +34,9 @@ then
|
|||||||
/bin/echo "[+] Signature is valid!"
|
/bin/echo "[+] Signature is valid!"
|
||||||
/bin/echo "[+] Upgrading..."
|
/bin/echo "[+] Upgrading..."
|
||||||
/bin/tar -xvf $file -C /
|
/bin/tar -xvf $file -C /
|
||||||
/bin/rm $file /tmp/sig
|
/bin/rm /tmp/sig
|
||||||
/bin/echo "[+] Done"
|
/bin/echo "[+] Done"
|
||||||
else
|
else
|
||||||
/bin/echo "[-] Signature error, exiting..."
|
/bin/echo "[-] Signature error, exiting..."
|
||||||
/bin/rm $file /tmp/sig
|
/bin/rm /tmp/sig
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user