mirror of https://github.com/OpenIPC/firmware.git
self-update if any online operation is in args. (#422)
parent
c4c5a61898
commit
e4d73334d8
general/overlay/usr/sbin
|
@ -3,7 +3,7 @@
|
||||||
# OpenIPC.org | v.20220827
|
# OpenIPC.org | v.20220827
|
||||||
#
|
#
|
||||||
|
|
||||||
scr_version=1.0.6
|
scr_version=1.0.7
|
||||||
|
|
||||||
args=" $@"
|
args=" $@"
|
||||||
|
|
||||||
|
@ -109,9 +109,7 @@ free_resources() {
|
||||||
}
|
}
|
||||||
|
|
||||||
self_update() {
|
self_update() {
|
||||||
if echo "${args}" | grep "rootfs" || echo "${args}" | grep "kernel" || echo "${args}" | grep -- "-n" >/dev/null 2>&1; then
|
if echo "${args}" | grep -E "\-(k|r|w|url)" >/dev/null 2>&1; then
|
||||||
echo -e "\nOffline operations."
|
|
||||||
else
|
|
||||||
echo -e "\nChecking for sysupgrade update..."
|
echo -e "\nChecking for sysupgrade update..."
|
||||||
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"
|
||||||
if [ -f /tmp/sysupgrade ] && grep -q "#!/bin/sh" /tmp/sysupgrade; then
|
if [ -f /tmp/sysupgrade ] && grep -q "#!/bin/sh" /tmp/sysupgrade; then
|
||||||
|
@ -128,6 +126,8 @@ self_update() {
|
||||||
else
|
else
|
||||||
echo -e "\nVersion checking failed, proceeding with the installed version."
|
echo -e "\nVersion checking failed, proceeding with the installed version."
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo -e "\nOffline operations."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue