Startup sh for weatherstation

I have weatherstation connected to RPi2. When I manually run pywws on terminal, it works. Now I`m trying to run script automatically on start. I modified script from creator and put it in /etc/init.d as Script looks like this:


export PATH=$PATH:/usr/local/bin

# exit if NTP hasn't set computer clock
[ `ntpdc -c sysinfo | awk '/stratum:/ {print $2}'` -ge 10 ] && exit


# exit if process is running
[ -f $pidfile ] && kill -0 `cat $pidfile` && exit

# email last few lines of the logfile to see why it died
#if [ -f $logfile ]; then
#  log=/tmp/log-weather
#  tail -40 $logfile >$log
#  /home/osmc/weather/ $log "weather log"
#  rm $log
#  fi

# restart process
md /tmp/weather
pywws-livelog-daemon -v -p $pidfile $datadir $logfile start

But script doesnt start on startup (as Im aware of). What am I doing wrong?

Osmc is using systemd.
You should make a script (unit) for that.

There are several threads about this on the forum:

1 Like

Great, thanks for link