Created
June 8, 2019 11:35
-
-
Save jhochwald/5979493ebc38eb14edd2a562917d402a to your computer and use it in GitHub Desktop.
Download a new UniFi Controller Firmware and install it. Used to to automate the installation of newer controller firmware on a UniFi Cloud Key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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