Permalink
Browse files

Update upgrade_unifi.sh

Let script exit remote devices faster
  • Loading branch information...
stevejenkins committed Dec 20, 2018
1 parent a86b950 commit 1c1b59ee11c24dd83a8f2374d2d62c5331bb2851
Showing with 14 additions and 14 deletions.
  1. +14 −14 upgrade_unifi.sh
@@ -2,7 +2,7 @@

#################################################################################
# A simple script for remotely upgrading Ubiquiti UniFi hardware firmware
# Version 1.1 (Dec 20, 2018)
# Version 1.2 (Dec 20, 2018)
# by Steve Jenkins (http://www.stevejenkins.com/)
#
# Requires bash and sshpass (https://sourceforge.net/projects/sshpass/)
@@ -80,7 +80,7 @@ for i in "${U7PG2_ip_list[@]}"
do
echo "Upgrading UAP-AC-Lite/LR/Pro/EDU/M/M-PRO/IW/IW-Pro @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $U7PG2_fw
sudo upgrade $U7PG2_fw ;
EOF
done

@@ -89,7 +89,7 @@ for i in "${U7HD_ip_list[@]}"
do
echo "Upgrading UAP-HD/SHD/XG/BaseStationXG @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $U7HD_fw
sudo upgrade $U7HD_fw ;
EOF
done

@@ -98,7 +98,7 @@ for i in "${U7NHD_ip_list[@]}"
do
echo "Upgrading UAP-nanoHD/IW-HD @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $U7NHD_fw
sudo upgrade $U7NHD_fw ;
EOF
done

@@ -107,7 +107,7 @@ for i in "${BZ2_ip_list[@]}"
do
echo "Upgrading UAP, UAP-LR, UAP-OD, UAP-OD5 @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $BZ2_fw
sudo upgrade $BZ2_fw ;
EOF
done

@@ -116,7 +116,7 @@ for i in "${US2v2_ip_list[@]}"
do
echo "Upgrading UAP-v2, UAP-LR-v2 @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $US2v2_fw
sudo upgrade $US2v2_fw ;
EOF
done

@@ -125,7 +125,7 @@ for i in "${U2IW_ip_list[@]}"
do
echo "Upgrading UAP-IW @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $U2IW_fw
sudo upgrade $U2IW_fw ;
EOF
done

@@ -134,7 +134,7 @@ for i in "${U7P_ip_list[@]}"
do
echo "Upgrading UAP-Pro @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $U7P_fw
sudo upgrade $U7P_fw ;
EOF
done

@@ -143,7 +143,7 @@ for i in "${U2HSR_ip_list[@]}"
do
echo "Upgrading UAP-OD+ at $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $U2HSR_fw
sudo upgrade $U2HSR_fw ;
EOF
done

@@ -152,7 +152,7 @@ for i in "${US24P250_ip_list[@]}"
do
echo "Upgrading USW @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $US24P250_fw
sudo upgrade $US24P250_fw ;
EOF
done

@@ -161,7 +161,7 @@ for i in "${US24PL2_ip_list[@]}"
do
echo "Upgrading US-L2-POE @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $US24PL2_fw
sudo upgrade $US24PL2_fw ;
EOF
done

@@ -170,7 +170,7 @@ for i in "${USXG_ip_list[@]}"
do
echo "Upgrading US-16-XG @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $USXG_fw
sudo upgrade $USXG_fw ;
EOF
done

@@ -179,7 +179,7 @@ for i in "${US6XG150_ip_list[@]}"
do
echo "Upgrading US-XG-6POE @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $US6XG150_fw
sudo upgrade $US6XG150_fw ;
EOF
done

@@ -188,7 +188,7 @@ for i in "${USMULT_ip_list[@]}"
do
echo "Upgrading USW-Multi @ $i..."
sshpass -p $password ssh -T -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username"@$i" << EOF
sudo upgrade $USMULT_fw
sudo upgrade $USMULT_fw ;
EOF
done

0 comments on commit 1c1b59e

Please sign in to comment.