Merge branch 'master' of github:OpenIPC/firmware

pull/310/head
Igor Zalatov (from Citadel PC) 2022-08-03 17:29:14 +03:00
commit 9821acc2c5
2 changed files with 18 additions and 15 deletions

View File

@ -1 +0,0 @@
../../general/package/openhisilicon

View File

@ -1,9 +1,9 @@
#!/bin/sh
#
# OpenIPC.org | v.20220727
# OpenIPC.org | v.20220803
#
scr_version=1.0.1
scr_version=1.0.2
args=" $@"
@ -113,19 +113,23 @@ free_resources() {
self_update() {
if echo "${args}" | grep "rootfs" || echo "${args}" | grep "kernel" || echo "${args}" | grep -- "-n" > /dev/null 2>&1; then
echo -e "\nOffline upgrade or Overlay clean, skip sysupgrade version check."
else
else
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"
dstv=`grep scr_version /tmp/sysupgrade | head -1 | cut -f 2 -d '='`
if ! [ "${scr_version}" = "${dstv}" ]; then
echo "A new version is available, trying to update..."
chmod +x /tmp/sysupgrade
echo -e "Done. Restarting...\n"
exec /tmp/sysupgrade ${args}
exit 1
else
echo "Ok, version match."
fi
curl -s -k -L -o /tmp/sysupgrade "https://raw.githubusercontent.com/OpenIPC/firmware/master/general/overlay/usr/sbin/sysupgrade"
if [ -f /tmp/sysupgrade ] && grep -q "#!/bin/sh" /tmp/sysupgrade; then
dstv=`grep scr_version /tmp/sysupgrade | head -1 | cut -f 2 -d '='`
if ! [ "${scr_version}" = "${dstv}" ]; then
echo "A new version is available, trying to run updated script..."
chmod +x /tmp/sysupgrade
exec /tmp/sysupgrade ${args}
echo -e "Done. Restarting...\n"
exit 1
else
echo "Ok, version match."
fi
else
echo -e "\nVersion check failed. Possible network connection problem, script is corrupt or not found. Continue with bundled version."
fi
fi
}