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-29 12:23:01 +02:00
|
|
|
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)"
|