first commit: some shell scripts

This commit is contained in:
TangChao
2022-08-22 08:38:59 +00:00
commit 5937333be7
8 changed files with 126 additions and 0 deletions

21
finger_daemon_while.sh Executable file
View File

@ -0,0 +1,21 @@
#! /bin/sh
PRO_NAME=psdk_demo
while true ; do
NUM=`ps -ef | grep ${PRO_NAME} | grep -v grep |wc -l`
# echo $NUM
if [ "${NUM}" -lt "1" ];then
echo "${PRO_NAME} was killed"
/bin/echo $(/bin/date +%F_%T) >> /home/rock/programRunLog/djiLog/runtime.log
psdkLogFileName=$(date +%Y%m%d_%H%M_%S).dji_log
sudo /home/rock/tc_projects/Payload_SDK_V2.2.1/sample/platform/linux/manifold2/project/build/psdk_demo &> /home/rock/programRunLog/djiLog/$psdkLogFileName
elif [ "${NUM}" -gt "1" ];then
echo "${PRO_NAME} is running"
fi
done
exit 0