停止:

#!/bin/bash
pid=`ps -ef|grep /opt/lampp|grep -v grep|awk '{print $2}'|wc -l`
b=0
if [ $pid -gt $b ]
then
ps -ef|grep /opt/lampp|grep -v grep|awk '{print $2}'|xargs kill -9
echo "lammp has stopped!"
else
echo "lammp is not running!"
fi
启动:

#!/bin/bash
pid=`ps -ef|grep /opt/lampp|grep -v grep|awk '{print $2}'|wc -l`
b=0
if [ $pid -gt $b ]
then
echo "lammp is already running!"
else
/opt/lampp/lampp start
echo "lammp has started!"
tail -f /opt/lampp/logs/access_log
fi

重启:

/tmp/stopl.sh
/tmp/startl.sh
~

相关文章:

  • 2021-10-20
  • 2021-12-27
  • 2021-09-18
  • 2022-12-23
  • 2021-12-06
  • 2021-12-27
  • 2022-12-23
猜你喜欢
  • 2021-09-24
  • 2021-12-07
  • 2022-01-14
  • 2021-10-17
  • 2022-12-23
相关资源
相似解决方案