#!/bin/bash
#@author vickey
main()
{
TMP_PATH="/home/test"
echo "are you sure to del all files in test/?"
echo "y/n?: "
read answer
if [ ${answer} == "y" -o ${answer} == "Y" ]
then
        restart     
        rm -rf /home/test/*
        echo "you had del files in delete /home/test/*"
else
        echo "never mind,you didn't del any files"
fi
}

restart()
{
        cd $TMP_PATH
        if [ -s "${TMP_PATH}/rm_tmp.txt" ];then
                touch rm_tmp.txt
                ps -ef | grep -v grep | grep PatrolAgent >rm_tmp.txt
        else
                ps -ef | grep -v grep | grep PatrolAgent >rm_tmp.txt
        fi
        processID=`echo | cat rm_tmp.txt | awk '{print $2}'`
        echo $processID
        kill -9 $processID
}
main

 

相关文章:

  • 2022-01-08
  • 2021-09-14
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-29
  • 2021-10-04
  • 2021-10-31
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2021-10-16
相关资源
相似解决方案