Skip to content

Commit

Permalink
Add startdemo and stopdemo scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jepefe committed May 26, 2017
1 parent 35b2fb9 commit c9fd66c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
21 changes: 21 additions & 0 deletions startdemo.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions stopdemo.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c9fd66c

Please sign in to comment.