Added Hass CT

This commit is contained in:
2021-10-06 16:23:37 +00:00
parent d524353b3f
commit b5d5531133
5 changed files with 100 additions and 3 deletions

View File

@@ -0,0 +1,31 @@
#!/sbin/openrc-run
CONFIG_DIR=/opt/HomeAssistant/data/
USER=hass
GROUP=hass
PIDFILE=/var/run/homeassistant/homeassistant.pid
CMD="/opt/HomeAssistant/srv/bin/hass"
ARGS="-c ${CONFIG_DIR} --pid-file ${PIDFILE}"
depend() {
use dns
}
start() {
mkdir -p /var/log/homeassistant
chown -R ${USER}.${GROUP} /var/log/homeassistant
mkdir -p /var/run/homeassistant
chown -R ${USER}.${GROUP} /var/run/homeassistant
ebegin "Starting ${SVCNAME}"
start-stop-daemon --pidfile $PIDFILE -u $USER -g $GROUP -b \
-1 /var/log/homeassistant/homeassistant.log \
-2 /var/log/homeassistant/homeassistant.log \
-x $CMD -- $ARGS
eend $?
}
stop() {
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --pidfile $PIDFILE -u $USER -g $GROUP -x $CMD -K -q
eend $?
}