linux中启动与终止lnmp的脚本

时间:2021-12-24 05:59:32

说是lnmp, 其实暂时只是 lnp, 因为还没有安装 mysql

这是脚本:

#!/bin/bash
function lnmpstart()
{
nginx
/usr/local/php/bin/php-cgi -b 127.0.0.1: -c /usr/local/php/lib/php.ini &
} function lnmpstop()
{
kill - `ps aux | grep php-cgi | grep -v grep | awk '{print $2}'`
kill - `ps aux | grep nginx | grep -v grep | awk '{print $2}'`
} if [ $# -eq ]; then
if [ $ = 'start' ]; then
lnmpstart
elif [ $ = 'stop' ]; then
lnmpstop
fi
else
echo 'Usage: lnmp.sh [OPTION]'
echo " lnmp.sh start Start daemons"
echo " lnmp.sh stop Stop daemons"
echo ""
fi