Skip to content

Commit

Permalink
wait for valid ip addr
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 17, 2024
1 parent e5186ae commit 966599a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nextiondriver.service
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SLEEP=/bin/sleep
USER=root
GROUP=mmdvm
LOGDIR=/var/log/pi-star
ipVar=`hostname -I | cut -d' ' -f1`

# Pre-flight checks...
test -x ${DAEMON_PATH}${DAEMON} || exit 0
Expand All @@ -44,6 +45,11 @@ case "$1" in
echo -e "$DAEMON is already running as PID "`$PGREP $DAEMON`
exit 0;
else
# Wait for an IP address
until [ "$ipVar" != "" ]; do
sleep 10
ipVar=`hostname -I | cut -d' ' -f1`
done
nice -n -10 ${DAEMON_PATH}${DAEMON} ${DAEMON_OPTS}
echo -e "$DAEMON started as PID "`$PGREP $DAEMON`
exit 0;
Expand Down

0 comments on commit 966599a

Please sign in to comment.