I put together a systemd service file instead of using an init script. It might be simpler to install and makes it a little easier to support multiple purpleairs (I have two for example -- an indoor and an outdoor).
# purple-proxy-01.service unit file
# Copyright (C) Daniel Rich <drich@employees.org>
[Unit]
Description=Proxy server for PurpleAir air quality sensor
After=network.target
[Service]
PIDFile=/run/purple-proxy-01.pid
TimeoutStartSec=0
ExecStart=/opt/purpleproxy-01/bin/purpleproxy-wrapper.sh --pidfile /run/purple-proxy-01.pid
Restart=always
Type=forking
WorkingDirectory=/opt/purpleproxy-01
[Install]
WantedBy=multi-user.target
WantedBy=weewx.service
I put together a systemd service file instead of using an init script. It might be simpler to install and makes it a little easier to support multiple purpleairs (I have two for example -- an indoor and an outdoor).