判断`nginx`是否运行
```
#!/bin/bash
name='nginx'
num=$(ps -ef|grep $name |grep -vc grep)
if [ $num -ge 1 ]; then
echo "$name is running!"
else
echo "$name is not running!"
fi
```
判断`php`脚本是否运行
```
#!/bin/bash
name='abc/cdn/run'
num=$(ps -ef|grep $name |grep -vc grep)
echo $num
if [ $num -ge 1 ]; then
echo "$name is running!"
else
echo "$name is not running!"
/app/php7.2/bin/php /app/www/cron/index.php abc/cdn/run &
fi
```