ubiquiti:controller:upgrade_controller
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ubiquiti:controller:upgrade_controller [2020/10/22 22:22] – created 192.168.1.1 | ubiquiti:controller:upgrade_controller [2022/10/11 10:28] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Ubiquiti - Controller - Upgrade Controller ====== | ====== Ubiquiti - Controller - Upgrade Controller ====== | ||
+ | |||
+ | Read the synopsis for the specific upgrade release at https:// | ||
+ | |||
+ | Obtain the URL from the **Download Links**. | ||
+ | |||
+ | * Example, https:// | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Use SSH ===== | ||
+ | |||
+ | <code bash> | ||
+ | ssh ubnt@192.168.1.10 | ||
+ | ubnt@192.168.1.10' | ||
+ | </ | ||
+ | |||
+ | <code bash> | ||
+ | cd /tmp | ||
+ | |||
+ | ls -l | ||
+ | |||
+ | rm unifi_sysvinit_all.deb | ||
+ | |||
+ | wget https:// | ||
+ | |||
+ | sudo dpkg -i unifi_sysvinit_all.deb | ||
+ | |||
+ | rm unifi_sysvinit_all.deb | ||
+ | </ | ||
+ | |||
+ | |||
+ | ---- | ||
===== On UDMP ===== | ===== On UDMP ===== | ||
Line 6: | Line 38: | ||
unifi-os shell | unifi-os shell | ||
- | rm / | + | rm / |
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | ===== Use Bash Script ===== | ||
+ | |||
+ | <code bash> | ||
+ | # | ||
+ | |||
+ | https_url=' | ||
+ | package_name=' | ||
+ | upgrade_log=" | ||
+ | |||
+ | # CLI opts | ||
+ | checksum='' | ||
+ | version='' | ||
+ | |||
+ | function cleanup | ||
+ | { | ||
+ | echo " | ||
+ | rm -rf " | ||
+ | } | ||
+ | |||
+ | function timestamp | ||
+ | { | ||
+ | local __tstamp=$1 | ||
+ | local mytstamp=$(date ' | ||
+ | if [[ " | ||
+ | then | ||
+ | eval $__tstamp="' | ||
+ | else | ||
+ | echo " | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | function usage | ||
+ | { | ||
+ | echo " | ||
+ | exit 1 | ||
+ | } | ||
+ | |||
+ | # Get command line args | ||
+ | while getopts ": | ||
+ | do | ||
+ | case " | ||
+ | c) | ||
+ | checksum=" | ||
+ | ;; | ||
+ | v) | ||
+ | version=" | ||
+ | ;; | ||
+ | *) | ||
+ | usage | ||
+ | ;; | ||
+ | esac | ||
+ | done | ||
+ | shift $((OPTIND-1)) | ||
+ | |||
+ | # Make sure required args are passed | ||
+ | if [ -z " | ||
+ | then | ||
+ | usage | ||
+ | fi | ||
+ | |||
+ | # Make sure checksum looks like a sha256 hash | ||
+ | if ! [[ ${checksum} =~ ^[0-9a-f]{64}$ ]] | ||
+ | then | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | # Get currently installed unifi package version | ||
+ | current_ver=$(dpkg -s unifi | grep ' | ||
+ | target_ver=$(echo " | ||
+ | |||
+ | # Don't bother upgrading to same version as installed | ||
+ | if [ " | ||
+ | then | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | # Create a temp dir to store downloads | ||
+ | if ! output_dir=$(mktemp -d -t unifi_${version}_$(date +%Y-%m-%d-%H-%M-%S)_XXXXXXXXXX) | ||
+ | then | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | trap cleanup 0 | ||
+ | |||
+ | # Download package | ||
+ | echo " | ||
+ | cd " | ||
+ | retval=$? | ||
+ | if [[ ! ${retval} -eq 0 ]] | ||
+ | then | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | # Verify package checksum | ||
+ | echo " | ||
+ | if [ -f " | ||
+ | then | ||
+ | echo " | ||
+ | if ! shasum -c " | ||
+ | then | ||
+ | echo " | ||
+ | exit 1 | ||
+ | else | ||
+ | echo " | ||
+ | dpkg --debug=1 --install " | ||
+ | fi | ||
+ | else | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | echo " | ||
+ | exit 0 | ||
+ | </ | ||
+ | |||
+ | Run it as: | ||
+ | |||
+ | <code bash> | ||
+ | ./ | ||
</ | </ | ||
Line 16: | Line 177: | ||
https:// | https:// | ||
+ | https:// |
ubiquiti/controller/upgrade_controller.1603405349.txt.gz · Last modified: 2020/10/22 22:22 by 192.168.1.1