diff --git a/tools/helpers/flashall b/tools/helpers/flashall index bd3d350..1951818 100644 --- a/tools/helpers/flashall +++ b/tools/helpers/flashall @@ -3,7 +3,8 @@ # reboot the modem into fastboot mode # flash kernel + rootfs and reboot echo "Sending AT+QFASTBOOT..." -sudo sh -c 'echo -ne "AT+QFASTBOOT\r" > /dev/ttyUSB2' +if [ $(id -u) -ne 0 ] ; then echo "This script must be run as root!" ; exit 1 ; fi +sh -c 'echo -ne "AT+QFASTBOOT\r" > /dev/ttyUSB2' fastboot oem stay fastboot flash aboot appsboot.mbn || exit "Failed to flash the bootloader" fastboot reboot @@ -15,4 +16,4 @@ fastboot flash:raw recovery boot-mdm9607.img || exit "Failed to flash recovery k fastboot flash system rootfs-mdm9607.ubi || exit "Failed to flash the system partition" fastboot flash recoveryfs recoveryfs.ubi || exit "Failed to flash the recovery partition" fastboot reboot -echo "Done!" \ No newline at end of file +echo "Done!"