19 lines
645 B
Bash
Executable File
19 lines
645 B
Bash
Executable File
#!/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}
|
|
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/
|
|
|
|
ssh root@${OPENWRT_DEVICE} sysupgrade --force -v -u "/tmp/firmwares/$(basename $FIRMWARE_FILE)" |