Skip to main content

Start Stop

Start 

#!/bin/bash

echo
echo '##### START KKo KKo Rack #####'
echo

wpa_cli -i wlan0 status 
echo
echo

FILENAME=/home/pi/stepperMotor/nohup.out
if [ -f "$FILENAME" ] ; then
	echo "nohup.out delete !"
	rm /home/pi/stepperMotor/nohup.out
else
	echo "file not exist"
fi

echo '##### START CCTV #####'
cd /home/pi/stepperMotor
nohup python3 /home/pi/stepperMotor/stepperMoter.py &  
sleep 3 

echo '##### START BROD SOUND #####'
nohup cvlc -vvv alsa://plughw:1 --sout '#transcode{acodec=mp3,ab=64,channels=1}:standard{access=http,dst=0.0.0.0:8080/out.mp3}' 1> /dev/null 2>&1 & 
sleep 3 

echo
echo '##### STARTed KKo KKo Rack #####'
echo



 

Stop

#!/bin/bash

echo
echo '##### STOP  KKo KKo Rack #####'
echo


ps -ef | grep stepperMoter.py | grep -v grep
KILLPID=`ps -ef | grep stepperMoter.py | grep -v grep | awk '{print($2)}'`
echo "Stop CCTV Process = " $KILLPID
kill -9 $KILLPID
sleep 3 

ps -ef | grep vlc | grep -v grep
KILLPID=`ps -ef | grep vlc | grep -v grep | awk '{print($2)}'`
echo "Stop Brod Sound Process = " $KILLPID
kill -9 $KILLPID
sleep 3 


echo
echo '##### STOPed KKo KKo Rack #####'
echo