From a4df7232860cf483cdf925ada73d3c0987f9f4e9 Mon Sep 17 00:00:00 2001 From: cronyx Date: Wed, 27 Jul 2022 17:16:44 +0300 Subject: [PATCH] sysupgrade: formatting --- building.sh | 2 +- general/overlay/usr/sbin/sysupgrade | 36 ++++++++++++++--------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/building.sh b/building.sh index db9431e2..ba4c0c65 100755 --- a/building.sh +++ b/building.sh @@ -652,7 +652,7 @@ xm550() { # gk7205v210 # OpenIPC # gk7205v300 # OpenIPC # gk7205v300_ultimate # OpenIPC_ultimate version -# gk7205v300_fpv # FPV (ultimate by default) +gk7205v300_fpv # FPV (ultimate by default) # gk7605v100 # testing.. # ####### diff --git a/general/overlay/usr/sbin/sysupgrade b/general/overlay/usr/sbin/sysupgrade index ae0e7551..0ae5126d 100755 --- a/general/overlay/usr/sbin/sysupgrade +++ b/general/overlay/usr/sbin/sysupgrade @@ -111,27 +111,27 @@ 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 - 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 - fi + 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 + 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 + fi } create_lock() { - [ -f /tmp/sysupgrade.lock ] && echo -e "\e[1;31m\nAnother sysupgrade process is already running!\e[0m\n" && exit 1 - touch /tmp/sysupgrade.lock + [ -f /tmp/sysupgrade.lock ] && echo -e "\e[1;31m\nAnother sysupgrade process is already running!\e[0m\n" && exit 1 + touch /tmp/sysupgrade.lock } get_device() {