We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

Script to deploy firmware to device using ethernet ipv6



  • #!/bin/sh

    while getopts "d:p:" opt;
    do
    case "${opt}" in
    d) device=${OPTARG};;
    p) pass=${OPTARG};;
    esac
    done

    if [ -z "$device" ]
    then
    echo "Ethernet device not set, use parameter -d <device>"
    exit 1;
    fi

    address=$(ping6 -c 1 -i 4 -I $device ff02::1 | grep "64 bytes from " | awk '{print $4}' | cut -d"%" -f1 | awk -F':' '{print $0}')

    if [ -z "$address" ]
    then
    echo "IP v6 address not set, use parameter -a <address>"
    exit 1;
    fi

    if [ -z "$pass" ]
    then
    echo "Password not set, use parameter -p <password>"
    exit 1;
    fi

    ssh-keygen -f "~/.ssh/known_hosts" -R "$address%$device"

    echo "Sending Firmware to device...\n"
    sshpass -p$pass scp -6 -o StrictHostKeyChecking=no ~/source/bin/targets/ramips/mt76x8/openwrt-ramips-mt76x8-omega2p-squashfs-sysupgrade.bin root@[$address%$device]:/tmp

    echo "Executing firmware update...\n"
    sshpass -p$pass ssh -6 -o StrictHostKeyChecking=no root@$address%$device sysupgrade -n /tmp/openwrt-ramips-mt76x8-omega2p-squashfs-sysupgrade.bin


  • administrators

    @crispyoz Looks interesting, but can you give some context?



  • @Lazar-Demin

    I need to deploy my custom firmware build to my Omega2S+ based devices, but since a new board will not have a wireless connection I need to use the ethernet connection also built into my board. So there is no reliance upon ipv4 address, this script finds the connected ipv6 device, uses scp to transfer the firmware to the device, then executes sysupgrade on the device.



Looks like your connection to Community was lost, please wait while we try to reconnect.