Added Hass CT
This commit is contained in:
31
CT-Files/hass/Configs/hass.service
Normal file
31
CT-Files/hass/Configs/hass.service
Normal 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 $?
|
||||
}
|
||||
Reference in New Issue
Block a user