User Tools

Site Tools


unifi_linux

This is an old revision of the document!


UniFi controller on CentOS 7

Installation

yum install mongodb-server unzip
yum localinstall jre-8u45-linux-x64.rpm

Make sure you have a minimum of 4GB in /opt

cd /opt
unzip /var/tmp/UniFi.unix.zip

Create the following init-script:

init script

/etc/init.d/unifi
#!/bin/bash
# chkconfig: 2345 95 20
# description: UniFi system
# processname: unifi

UNIFI_PATH=/opt/UniFi

ctrl_start() {
  java -jar $UNIFI_PATH/lib/ace.jar start &
}

ctrl_stop() {
  java -jar $UNIFI_PATH/lib/ace.jar stop &
}

ctrl_restart() {
  ctrl_stop
  sleep 1
  ctrl_start
}

case "$1" in
  start) echo -n "starting UniFi system: "
         ctrl_start
         echo "service started"
         ;;
  stop) echo -n "stopping UniFi system: "
        ctrl_stop
        echo "service stopped"
        ;;
  restart) echo -n "restarting UniFi system: "
           ctrl_restart
           echo "service restarted"
           ;;
  *) echo "usage: $0 {start|stop|restart}"
     ;;
esac

exit 0
unifi_linux.1434549304.txt.gz · Last modified: by herwarth