Initial commit of files
This commit is contained in:
26
bin-scripts/can-log-start
Executable file
26
bin-scripts/can-log-start
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
# log file name based on time
|
||||
TIMESTAMP=`date +'%Y-%m-%d_%H%M%S'`
|
||||
LOGDIR=.
|
||||
LOGFILE=$LOGDIR/candump-$TIMESTAMP.log
|
||||
PIDDIR=.
|
||||
PIDFILE=$PIDDIR/can-log.pid
|
||||
IF=any
|
||||
|
||||
# log directory
|
||||
if [ ! -d $LOGDIR ]; then
|
||||
echo "Please run cnomicon-setup!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# kill if already running (restart)
|
||||
if [ -f $PIDFILE ]; then
|
||||
sudo pkill -F $PIDFILE
|
||||
fi
|
||||
|
||||
# let 'er rip
|
||||
candump -L -l any > $LOGFILE &
|
||||
echo $! > $PIDFILE
|
||||
|
||||
echo "CANdump logging started to $LOGFILE"
|
||||
Reference in New Issue
Block a user