mirror of
https://github.com/weewx/weewx.git
synced 2026-04-21 01:57:00 -04:00
41 lines
728 B
Bash
Executable File
41 lines
728 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Start script for FreeBSD, contributed by user Fabian Abplanalp
|
|
# Adjust WEEWX_ROOT as appropriate.
|
|
# Then put this script in /usr/local/etc/rc.d
|
|
#
|
|
WEEWX_ROOT="/opt/weewx"
|
|
PIDFILE="/var/run/weewx.pid"
|
|
|
|
case "$1" in
|
|
"start")
|
|
echo "Starting weewx..."
|
|
/usr/local/bin/python ${WEEWX_ROOT}/bin/weewxd.py ${WEEWX_ROOT}/weewx.conf --daemon &
|
|
echo $! > ${PIDFILE}
|
|
echo "done"
|
|
;;
|
|
|
|
"stop")
|
|
echo "Stopping weewx..."
|
|
if [ -f ${PIDFILE} ] ; then
|
|
kill `cat ${PIDFILE}`
|
|
rm ${PIDFILE}
|
|
echo "done"
|
|
else
|
|
echo "not running?"
|
|
fi
|
|
;;
|
|
|
|
"restart")
|
|
echo "Restarting weewx..."
|
|
$0 stop
|
|
sleep 2
|
|
$0 start
|
|
;;
|
|
|
|
*)
|
|
echo "$0 [start|stop|restart]"
|
|
;;
|
|
|
|
esac
|