Skip to content

Commit

Permalink
remove output in terminal after service is started
Browse files Browse the repository at this point in the history
  • Loading branch information
persandstrom committed Sep 18, 2015
1 parent b33714b commit 9d7aef9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion script/hass-daemon
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ RUN_AS="USER"
PID_FILE="/var/run/hass.pid"
CONFIG_DIR="/var/opt/homeassistant"
FLAGS="-v --config $CONFIG_DIR --pid-file $PID_FILE --daemon"
REDIRECT="> $CONFIG_DIR/home-assistant.log 2>&1"

start() {
if [ -f $PID_FILE ] && kill -0 $(cat $PID_FILE); then
echo 'Service already running' >&2
return 1
fi
echo 'Starting service…' >&2
local CMD="$PRE_EXEC hass $FLAGS;"
local CMD="$PRE_EXEC hass $FLAGS $REDIRECT;"
su -c "$CMD" $RUN_AS
echo 'Service started' >&2
}
Expand Down

0 comments on commit 9d7aef9

Please sign in to comment.