diff options
author | pks <pks@pks.rocks> | 2021-05-01 06:16:19 +0200 |
---|---|---|
committer | pks <pks@pks.rocks> | 2021-05-01 06:16:19 +0200 |
commit | 63fbf0f3aadb4b6d037a8164b501fe836d9c361d (patch) | |
tree | a33240dfd9ad5c57f283e942514bb8ce67d71085 /weather-logger | |
parent | 00fdbd489494c917865cf3fbf153e5751052e2d1 (diff) |
v1
Diffstat (limited to 'weather-logger')
-rwxr-xr-x | weather-logger | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/weather-logger b/weather-logger index fc1f6a8..84be622 100755 --- a/weather-logger +++ b/weather-logger @@ -1,16 +1,24 @@ #!/bin/sh -# /etc/init.d/weather-logger - +### BEGIN INIT INFO +# Provides: weather-logger +# Required-Start: $all +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: weather-logger +### END INIT INFO export SUFFIX=$(date +'%Y-%m-%d-%H:%M:%S') export USER=pks -export DIR=/home/$USER/weather/ +export DIR=/home/$USER/weather_logger/ +export PYTHONPATH=/home/$USER/.local/lib/python3.7/site-packages/ case "$1" in start) echo "Starting weather-logger" rm -f $DIR/stop - runuser -l $USER -c "source $DIR/env/bin/activate && python $DIR/receive.py 2>$DIR/weather.$SUFFIX.err > $DIR/weather.$SUFFIX.out" & + #runuser -l $USER -c "source $DIR/env/bin/activate && python $DIR/receive.py 2>$DIR/weather.$SUFFIX.err > $DIR/weather.$SUFFIX.out" & + runuser -l $USER -c "python3.7 $DIR/receive.py 2>$DIR/log/weather.$SUFFIX.err > $DIR/log/weather.$SUFFIX.out" & ;; stop) echo "Stopping weather-logger" |