#!/bin/sh date >>/home/EdgeGateway_FSU_App/log/Devicestartup.log echo "Killall SubProcess">>//home/EdgeGateway_FSU_App/log/Devicestartup.log cd /home/EdgeGateway_FSU_App/App #判断进程是否存在,如果不存在就启动它 PIDS=`ps -ef |grep TimeAlignedApp |grep -v grep | awk '{print $2}'` if [ "$PIDS" != "" ]; then echo "TimeAlignedApp is runing!">>//home/EdgeGateway_FSU_App/log/Devicestartup.log killall -9 TimeAlignedApp fi PIDS=`ps -ef |grep MqttClientApp |grep -v grep | awk '{print $2}'` if [ "$PIDS" != "" ]; then echo "MqttClientApp is runing!">>//home/EdgeGateway_FSU_App/log/Devicestartup.log killall -9 MqttClientApp fi PIDS=`ps -ef |grep DevicePortGetApp |grep -v grep | awk '{print $2}'` if [ "$PIDS" != "" ]; then echo "Killall DevicePortGetApp">>//home/EdgeGateway_FSU_App/log/Devicestartup.log killall -9 DevicePortGetApp fi PIDS=`ps -ef |grep MainProcessApp |grep -v grep | awk '{print $2}'` if [ "$PIDS" != "" ]; then echo "MainProcessApp is runing!">>//home/EdgeGateway_FSU_App/log/Devicestartup.log killall -9 MainProcessApp fi echo "检查完成,可以执行相关进程" echo "检查完成,可以执行相关进程">>//home/EdgeGateway_FSU_App/log/Devicestartup.log