Skip to main content

Start and Stop Shell

Start and Stop Shell 

 

Start Shell

#!/bin/bash

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

wpa_cli -i wlan0 status 
echo
echo

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

echo '##### START CCTV #####'
cd /home/hyunsu/work/opencv
nohup python3 /home/hyunsu/work/opencv/serverUsb.py &  

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 & 


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



Stop Shell

#!/bin/bash

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


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


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

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