From a73874c9aaf882ff8c57cc975404576edb9ab87f Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Fri, 31 Aug 2018 09:37:44 -0700 Subject: [PATCH] Script to upgrade LANforge over device-under-test. (Or other non-mgt connection) --- upgrade_over_dut.bash | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 upgrade_over_dut.bash diff --git a/upgrade_over_dut.bash b/upgrade_over_dut.bash new file mode 100755 index 00000000..34768081 --- /dev/null +++ b/upgrade_over_dut.bash @@ -0,0 +1,37 @@ +#!/bin/bash + +# This script is used to upgrade LANforge over the eth1 (non-managment) +# interface connected to some DUT. This may be helpful in cases where +# the management interface is off the network for security or other reasons. + +LFVER=4.3.8 +KVER=4.16.18+ + +# Echo the commands to stdout for debugging purposes. +set -x + +# Stop lanforge +/home/lanforge/serverctl.bash stop + +# Remove other LANforge routing rules +./clean_route_rules.pl + +# Remove default route from mgt port +ip route del 0.0.0.0/0 dev eth0 + +# Remove all the wireless interfaces +rmmod ath10k_pci +rmmod ath9k + +# Assume eth1 is connected to a network that can route to internet +ifconfig eth1 down +pkill -f "dhclient eth1" + +ifconfig eth1 up +dhclient eth1 +curl -o lf_kinstall.pl http://www.candelatech.com/lf_kinstall.txt || exit 1 +chmod a+x lf_kinstall.pl + +./lf_kinstall.pl --do_all_ct --lfver $LFVER --kver $KVER || exit 2 + +echo "Reboot now to complete upgrade."