Skip to content

Instantly share code, notes, and snippets.

@jhochwald
Created August 10, 2019 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhochwald/33407ae7ea20bf5090e3ed88c48e69b7 to your computer and use it in GitHub Desktop.
Save jhochwald/33407ae7ea20bf5090e3ed88c48e69b7 to your computer and use it in GitHub Desktop.
Download a new UniFi Controller Firmware and install it
#!/usr/bin/env bash
# Download a new UniFi Controller Firmware and install it
# Used to to automate the installation of newer controller firmware on a UniFi Cloud Key
# Author: Joerg Hochwald
# Copyright: Copyright (c) 2019, Joerg Hochwald - All rights reserved.
# LICENSE: License: https://opensource.org/licenses/BSD-3-Clause
# THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
if [ $1 ]; then
echo "Param is $1"
# File Name (e.g. where to save)
FILE=/tmp/unifi_sysvinit_all.deb
# make sure we are in the temp directory, just in case
cd /tmp
# Get the new file
wget $1 -O $FILE
# Check if we get the file
if test -f "$FILE"; then
# Install the new file
dpkg -i $FILE
# Cleanup
rm -rf $FILE
fi
else
echo "Please use the Source URL (From the UBNT Forum?) as parameter!"
echo 'Sample: ./unifi_controller_update.sh https://dl.ui.com/unifi/5.10.24/unifi_sysvinit_all.deb'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment