From c9fd66c39d5bb4a8351af457ab2b3de34bcd981c Mon Sep 17 00:00:00 2001 From: Jesus Perez Date: Fri, 26 May 2017 10:57:50 +0200 Subject: [PATCH] Add startdemo and stopdemo scripts --- startdemo.sh | 21 +++++++++++++++++++++ stopdemo.sh | 13 +++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 startdemo.sh create mode 100755 stopdemo.sh diff --git a/startdemo.sh b/startdemo.sh new file mode 100755 index 0000000..4eb1d09 --- /dev/null +++ b/startdemo.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +dir=$(dirname $0) + +# Stop services +svc -d /service/serial-starter +svc -d /service/vecan-mk2 +svc -d /service/vecan +killall vedirect_dbus +killall gps_dbus + +start() { + ${dir}/dbusrecorder.py -p --file="${dir}/$1" & +} + +# Start services +start grid.dat +start pvinverter.dat +start solarcharger.dat +start vebus.dat +start battery.dat diff --git a/stopdemo.sh b/stopdemo.sh new file mode 100755 index 0000000..797b5d3 --- /dev/null +++ b/stopdemo.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Stop services +PID=`pgrep -f dbusrecorder.py | tr '\n' ' '` +echo "PID(dbusrecorder) = $PID" +[ -z "$PID" ] || kill -9 $PID + +if [ "$1" != "booting" ]; then + # Start services + svc -u /service/serial-starter + svc -u /service/vecan-mk2 + svc -u /service/vecan +fi