#!/bin/bash

sed -i "s/rlimit-nproc=3/#rlimit-nproc=3/" /etc/avahi/avahi-daemon.conf

cd /root/.homebridge
file="/root/.homebridge/package.json"
if [ -f "$file" ]
then
	echo "$file found. Going to install additional plugins."
	npm run install
else
	echo "$file not found. You can create this file to install additional plugins not already included in the docker image."
fi

rm /var/run/dbus/pid

dbus-daemon --system
avahi-daemon -D

homebridge

#!/bin/bash

sed -i "s/rlimit-nproc=3/#rlimit-nproc=3/" /etc/avahi/avahi-daemon.conf

cd /root/.homebridge
file="/root/.homebridge/package.json"
if [ -f "$file" ]
then
	echo "$file found. Going to install additional plugins."
	npm run install
else
	echo "$file not found. You can create this file to install additional plugins not already included in the docker image."
fi

rm -f /var/run/dbus/pid /var/run/avahi-daemon/pid

dbus-daemon --system
avahi-daemon -D

homebridge

Remove the avahi-daemon pid file too
Remove the avahi-daemon pid file too
