run updated sysupgrade from tmp

pull/279/head
cronyx 2022-07-27 02:07:41 +03:00
parent eeab52b400
commit 4c75ce7352
1 changed files with 4 additions and 4 deletions

View File

@ -112,16 +112,16 @@ free_resources() {
self_update() { self_update() {
if echo ${args} | grep "rootfs" || echo ${args} | grep "kernel" > /dev/null 2>&1; then if echo ${args} | grep "rootfs" || echo ${args} | grep "kernel" > /dev/null 2>&1; then
echo "Offline upgrade, skip sysupgrade version check." echo -e "\nOffline upgrade, skip sysupgrade version check."
else else
echo "Online upgrade, checking sysupgrade version..." echo -e "\nOnline upgrade, checking sysupgrade version..."
curl -s -k -L -o /tmp/sysupgrade "https://raw.githubusercontent.com/OpenIPC/firmware/master/general/overlay/usr/sbin/sysupgrade" curl -s -k -L -o /tmp/sysupgrade "https://raw.githubusercontent.com/OpenIPC/firmware/master/general/overlay/usr/sbin/sysupgrade"
dstv=`grep scr_version /tmp/sysupgrade | head -1 | cut -f 2 -d '='` dstv=`grep scr_version /tmp/sysupgrade | head -1 | cut -f 2 -d '='`
if ! [ "${scr_version}" = "${dstv}" ]; then if ! [ "${scr_version}" = "${dstv}" ]; then
echo "A new version is available, trying to update..." echo "A new version is available, trying to update..."
mv /tmp/sysupgrade /usr/sbin/ ; chmod +x /usr/sbin/sysupgrade chmod +x /tmp/sysupgrade
echo -e "Done. Restarting...\n" echo -e "Done. Restarting...\n"
exec "$0" ${args} exec /tmp/sysupgrade ${args}
exit 1 exit 1
else else
echo "Ok, version match." echo "Ok, version match."