mirror of https://github.com/aredn/aredn.git
25 lines
334 B
Bash
Executable File
25 lines
334 B
Bash
Executable File
#!/bin/sh
|
|
|
|
N=`ls /tmp/*.trx 2>/dev/null | wc -l`
|
|
|
|
if [ $N == 0 ]; then
|
|
echo "no image to flash"
|
|
exit 1
|
|
fi
|
|
|
|
if [ $N -gt 1 ]; then
|
|
echo "more than one image found"
|
|
exit 1
|
|
fi
|
|
|
|
mtd write /tmp/*.trx firmware
|
|
|
|
if [ $? != 0 ]; then
|
|
echo "ERROR: flash write failed!"
|
|
exit
|
|
fi
|
|
|
|
echo "flash written successfully - rebooting"
|
|
reboot
|
|
|