Files
nanopi-openwrt-r1s-h3/JUNK/flash.sh
2020-03-19 18:05:09 +01:00

17 lines
324 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/ash
if ! type "pv" > /dev/null; then
opkg update ; opkg install pv
if ! type "pv" > /dev/null; then
echo 'pv安装失败退出...'
exit 1
fi
fi
if [ -f /tmp/upload/rom.img.gz ]; then
pv /tmp/upload/rom.img.gz | gunzip -dc > /dev/mmcblk0
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
fi