emissary-firmware/misc/script/flash.sh

19 lines
645 B
Bash
Raw Permalink Normal View History

2023-02-03 16:40:47 +01:00
#!/bin/bash
set -xeo pipefail
ssh-copy-id root@${OPENWRT_DEVICE}
TARGET_ARCH=$(ssh root@${OPENWRT_DEVICE} source /etc/os-release \&\& echo \${OPENWRT_BOARD:-\$LEDE_BOARD})
FIRMWARE_FILENAME=${FIRMWARE_FILENAME:-openwrt-*-sysupgrade.img*}
FIRMWARE_FILE=bin/${OPENWRT_VERSION}/${TARGET_ARCH}/${OPENWRT_PROFILE}/${FIRMWARE_FILENAME}
2023-02-03 16:40:47 +01:00
FIRMWARE_FILE=${CUSTOM_FIRMWARE_FILE:-$FIRMWARE_FILE}
ssh root@${OPENWRT_DEVICE} \
mkdir -p /tmp/firmwares \
\&\& rm /tmp/firmwares/* \|\| exit 0;
scp $FIRMWARE_FILE root@${OPENWRT_DEVICE}:/tmp/firmwares/
2023-03-27 19:28:58 +02:00
ssh root@${OPENWRT_DEVICE} sysupgrade --force -v -u "/tmp/firmwares/$(basename $FIRMWARE_FILE)"