Reply
New Member
Posts: 3
Registered: ‎08-22-2014

I can't install mfi controller on Raspberry Pi

there in an article

How to Install Ubiquiti mFi Controller 2 on the Raspberry Pi

 https://www.technologist.site/2015/07/14/how-to-install-ubiquiti-mfi-controller-2-on-the-raspberry-p...

 

I follow it ,step by step.but it not work.

I can't find reson.

 

 

 

mfi.jpg
Highlighted
New Member
Posts: 3
Registered: ‎08-22-2014

mFi Startup Script for Raspberry Pi .

#!/bin/bash # # /etc/init.d/mFi -- Ubiquiti mFi Startup Script for Raspberry Pi # # ### BEGIN INIT INFO # Provides: mfi # Required-Start: $local_fs $remote_fs $network # Required-Stop: $local_fs $remote_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Ubiquiti mFi # Description: Ubiquiti mFi Controller ### END INIT INFO NAME="mfi" DESC="Ubiquiti mFi Controller" BASEDIR="/usr/lib/mFi" MAINCLASS="com.ubnt.ace.Launcher" PIDFILE="/var/run/${NAME}/${NAME}.pid" PATH=/bin:/usr/bin:/sbin:/usr/sbin MONGOPORT=27117 MONGOLOCK="${BASEDIR}/data/db/mongod.lock" ENABLE_MFI=yes JVM_EXTRA_OPTS= JSVC_EXTRA_OPTS= [ -f /etc/default/${NAME} ] && . /etc/default/${NAME} [ "x${ENABLE_MFI}" != "xyes" ] && exit 0 JVM_OPTS="${JVM_EXTRA_OPTS} -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx1024M" #set_java_home JAVA_HOME="/usr/lib/jvm/jdk-7-oracle-arm-vfp-hflt/jre" # JSVC - for running java apps as services JSVC=`which jsvc` #JSVC_OPTS="-debug" JSVC_OPTS="${JSVC_OPTS}\ -home ${JAVA_HOME} \ -cp /usr/share/java/commons-daemon.jar:${BASEDIR}/lib/ace.jar \ -pidfile ${PIDFILE} \ -procname ${NAME} \ -outfile SYSLOG \ -errfile SYSLOG \ ${JSVC_EXTRA_OPTS} \ ${JVM_OPTS}" [ -f /etc/default/rcS ] && . /etc/default/rcS . /lib/lsb/init-functions [ -d /var/run/${NAME} ] || mkdir -p /var/run/${NAME} cd ${BASEDIR} is_not_running() { start-stop-daemon --test --start --pidfile "${PIDFILE}" \ --startas "${JAVA_HOME}/bin/java" >/dev/null RC=$? return ${RC} } case "$1" in start) log_daemon_msg "Starting ${DESC}" "${NAME}" if is_not_running; then ${JSVC} ${JSVC_OPTS} ${MAINCLASS} start sleep 1 if is_not_running; then log_end_msg 1 else log_end_msg 0 fi else log_progress_msg "(already running)" log_end_msg 1 fi ;; stop) log_daemon_msg "Stopping ${DESC}" "${NAME}" if is_not_running; then log_progress_msg "(not running)" else ${JSVC} ${JSVC_OPTS} -stop ${MAINCLASS} stop for i in `seq 1 10` ; do [ -z "$(pgrep -f ${BASEDIR}/lib/ace.jar)" ] && break # graceful shutdown [ $i -gt 1 ] && [ -d ${BASEDIR}/run ] && touch ${BASEDIR}/run/server.stop || true # savage shutdown [ $i -gt 7 ] && pkill -f ${BASEDIR}/lib/ace.jar || true sleep 1 done # shutdown mongod if [ -f ${MONGOLOCK} ]; then mongo localhost:${MONGOPORT} --eval "db.getSiblingDB('admin').shutdownServer()" >/dev/null 2>&1 fi fi log_end_msg 0 ;; status) status_of_proc -p ${PIDFILE} mfi mfi && exit 0 || exit $? ;; restart|reload|force-reload) if ! is_not_running ; then if which invoke-rc.d >/dev/null 2>&1; then invoke-rc.d ${NAME} stop else /etc/init.d/${NAME} stop fi fi if which invoke-rc.d >/dev/null 2>&1; then invoke-rc.d ${NAME} start else /etc/init.d/${NAME} start fi ;; *) log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}" exit 1 ;; esac exit 0
Reply