#!/bin/sh ########################################################################### # # Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file run.sh # # @author (last) Behrouz NematiPour # @date (last) 25-Aug-2020 # @author (original) Behrouz NematiPour # @date (original) 28-Oct-2019 # ############################################################################ HOME=/home/root SDCARD_DEV=/dev/mmcblk1p1 SDCARD_MNT=/media/sd-card USB_DEV=/dev/sda1 USB_MNT=/media/usb LOG_PATH=$SDCARD_MNT #create folders for sd-card and usb if not exist mkdir -p $SDCARD_MNT mkdir -p $USB_MNT #mounting usb mount $USB_DEV $USB_MNT if [ $? -eq 0 ]; then echo ":: USB drive found and mounted on $USB_MNT" fi #A simple none secure update if [ -e $USB_MNT/denali ]; then mv $HOME/denali $HOME/denali.$(date +"%d%m%Y%H%M%S") cp $USB_MNT/denali $HOME/denali sync;sync;sync; mv $USB_MNT/denali $USB_MNT/denali.updated sync;sync;sync; fi # check if update where successful if [ $? -eq 0 ]; then echo ":: Denali application has been updated with the one on the USB drive" fi #setting up can interface # current settings can be retrieved by the command below # $ ip -details -statistics link show can0 ip link set can0 up type can bitrate 250000 restart-ms 100 ifconfig can0 txqueuelen 4000 if [ $? -eq 0 ]; then echo ":: Can interface setup" fi #mounting sdcard mount $SDCARD_DEV $SDCARD_MNT if [ $? -eq 0 ]; then echo ":: SD-Card found and mounted on $SDCARD_MNT" else #setting the can log location LOG_PATH=$HOME fi echo ":: Log location set to $LOG_PATH" #launching candump and setting the can log locations #candump can0 1>$LOG_PATH/canmsg.log 2>$LOG_PATH/canmsg.err & #if [ $? -eq 0 ]; then # echo ":: candump launched" #fi # setup bluetooth mkdir -p "$SDCARD_MNT/treatment" sleep 5 killall connmand /usr/share/silex-uart/silex-uart.sh start hciconfig hci0 up #launching denali application, disable keep-alive $HOME/denali -u 2>> $HOME/filesystem.err &