Skip to content

Commit

Permalink
Updated to check if the script is run with root.
Browse files Browse the repository at this point in the history
  • Loading branch information
Spagett1 authored Nov 27, 2022
1 parent 4f2b049 commit 2a38474
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tools/helpers/flashall
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
# reboot the modem into fastboot mode
# flash kernel + rootfs and reboot
echo "Sending AT+QFASTBOOT..."
if command -v doas >> /dev/null; then
root=doas
else
root=sudo
fi
$root 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
Expand Down

0 comments on commit 2a38474

Please sign in to comment.