mirror of
https://github.com/mtan93/unifi-linux-utils.git
synced 2026-04-03 14:23:09 +01:00
Added service name as a config option
Added UNIFI_SERVICE configuration variable, so that systems with different service names (UniFi, unifi, etc.) can run the script. Fixes issue #1.
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
# Easy UniFi Controller Upgrade Script for Unix/Linux Systems
|
# Easy UniFi Controller Upgrade Script for Unix/Linux Systems
|
||||||
# by Steve Jenkins (stevejenkins.com)
|
# by Steve Jenkins (stevejenkins.com)
|
||||||
# Version 2.0
|
# Version 2.0
|
||||||
# Last Updated July 2, 2016
|
# Last Updated Nov 26, 2016
|
||||||
|
|
||||||
# REQUIREMENTS
|
# REQUIREMENTS
|
||||||
# 1) Assumes you already have any version of UniFi Controller installed
|
# 1) Assumes you already have any version of UniFi Controller installed
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
UNIFI_DOWNLOAD_URL=http://dl.ubnt.com/unifi/5.0.7/UniFi.unix.zip
|
UNIFI_DOWNLOAD_URL=http://dl.ubnt.com/unifi/5.0.7/UniFi.unix.zip
|
||||||
UNIFI_ARCHIVE_FILENAME=UniFi.unix.zip
|
UNIFI_ARCHIVE_FILENAME=UniFi.unix.zip
|
||||||
UNIFI_OWNER=ubnt
|
UNIFI_OWNER=ubnt
|
||||||
|
UNIFI_SERVICE=UniFi
|
||||||
UNIFI_PARENT_DIR=/opt
|
UNIFI_PARENT_DIR=/opt
|
||||||
UNIFI_DIR=/opt/UniFi
|
UNIFI_DIR=/opt/UniFi
|
||||||
UNIFI_BACKUP_DIR=/opt/UniFi_bak
|
UNIFI_BACKUP_DIR=/opt/UniFi_bak
|
||||||
@@ -59,7 +60,7 @@ if [ -f "$UNIFI_ARCHIVE_FILENAME" ]; then
|
|||||||
|
|
||||||
# Stop the local UniFi Controller service
|
# Stop the local UniFi Controller service
|
||||||
printf "\n"
|
printf "\n"
|
||||||
service UniFi stop
|
service $UNIFI_SERVICE stop
|
||||||
|
|
||||||
# Remove previous backup directory (if it exists)
|
# Remove previous backup directory (if it exists)
|
||||||
if [ -d "$UNIFI_BACKUP_DIR" ]; then
|
if [ -d "$UNIFI_BACKUP_DIR" ]; then
|
||||||
@@ -94,7 +95,7 @@ if [ -f "$UNIFI_ARCHIVE_FILENAME" ]; then
|
|||||||
|
|
||||||
# Restart the local UniFi Controller service
|
# Restart the local UniFi Controller service
|
||||||
printf "\n"
|
printf "\n"
|
||||||
service UniFi start
|
service $UNIFI_SERVICE start
|
||||||
|
|
||||||
# All done!
|
# All done!
|
||||||
printf "\nUpgrade of UniFi Controller complete!\n"
|
printf "\nUpgrade of UniFi Controller complete!\n"
|
||||||
@@ -107,4 +108,4 @@ else
|
|||||||
printf "\nUniFi Controller software not found! Please check download link.\n"
|
printf "\nUniFi Controller software not found! Please check download link.\n"
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user