From d859dcbf4e0d0bd871468c4be76b3b2aab23ef5c Mon Sep 17 00:00:00 2001 From: Trek H Date: Sat, 16 May 2020 23:48:11 +0930 Subject: [PATCH] init: unit service stays running --- init/pi_run.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/init/pi_run.sh b/init/pi_run.sh index 5c5198bc..fa04c1b9 100644 --- a/init/pi_run.sh +++ b/init/pi_run.sh @@ -33,6 +33,14 @@ HOME=/home/pi GOPATH=$HOME/go RVPATH=$GOPATH/src/bitbucket.org/ausocean/av/cmd/rv PATH=$PATH:/usr/local/go/bin:$RVPATH +echo $RVPATH cd $RVPATH -sudo -u pi HOME=$HOME GOPATH=$GOPATH PATH=$PATH ./rv & -exit 0 +sudo -u pi HOME=$HOME GOPATH=$GOPATH PATH=$PATH ./rv +if [ $? -eq 0 ] +then + echo "Successfully exited rv" + exit 0 +else + echo "rv exited with code: $?" >&2 + exit 1 +fi