运行脚本

master
pan 4 years ago
parent c1307fecc2
commit 71d5e2f0c0
  1. 6
      run.sh

@ -9,14 +9,14 @@ function run(){
touch $pid.log && chmod +x $pid.log touch $pid.log && chmod +x $pid.log
} }
if [ -e *.pid ] if [ -e *.log ]
then then
pid=`stat *.pid|awk 'NR>1{next}{c=$0;gsub(/\D/,"",c);print c}'` pid=`stat *.log|awk 'NR>1{next}{c=$0;gsub(/\D/,"",c);print c}'`
kill -9 pid kill -9 pid
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
echo 'kill $pid success' echo 'kill $pid success'
rm -f *.pid rm -f *.log
run run
else else
echo 'kill $pid error' echo 'kill $pid error'

Loading…
Cancel
Save