iup224: fix cicling reboot

This commit is contained in:
Alex Oprea 2016-05-04 17:07:02 +02:00
parent a6abec5787
commit 97306df0a9

View file

@ -50,22 +50,22 @@ else
exit 1
fi
sofwareminuspath=${url##*/}
softwareminuspath=${url##*/}
if [ $url ] && [ $active -eq 1 ]; then
echo "Software version to download $sofwareminuspath"
echo "Software version to download $softwareminuspath"
local sysinfo=$(ubus call router quest "{ \"info\": \"system\" }")
json_load "$sysinfo"
json_get_var firmware firmware
json_get_var filesystem filesystem
if [ "$filesystem" == "JFFS2" ] ; then
firmware=$firmware.w
firmware1=$firmware.w
firmware2=$firmware.w
else
firmware=$firmware.y
firmware1=$firmware.y
firmware2=$firmware.y2
fi
if [ "$sofwareminuspath" == "${sofwareminuspath/$firmware/}" -o "$sofwareminuspath" == "${sofwareminuspath/$firmware2/}" ] ; then
if [ "$softwareminuspath" == "${softwareminuspath/$firmware1/}" -o "$softwareminuspath" == "${softwareminuspath/$firmware2/}" ] ; then
echo "Image found $url will start flashing"
/sbin/sysupgrade -v $url &
exit 1