emissary-firmware/misc/script/flash.sh

18 lines
584 B
Bash
Raw 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})
2023-03-27 19:28:58 +02:00
FIRMWARE_FILE=bin/${OPENWRT_VERSION}/${TARGET_ARCH}/${OPENWRT_PROFILE}/openwrt-*-sysupgrade.img*
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)"