「インストール - Zsh」の版間の差分

ナビゲーションに移動 検索に移動
328行目: 328行目:
    
    
     return 0
     return 0
}
# Apache2とMySQLの起動
function startlamp()
{
    local APACHE2_STATUS=$(sudo systemctl status apache2 | grep -ie "Active:" | grep -ie "dead")
    if [ -n "APACHE2_STATUS" ]; then
      sudo systemctl start apache2
    fi
    local MYSQL8_STATUS=$(sudo systemctl status mysql | grep -ie "Active:" | grep -ie "dead")
    if [ -n "MYSQL8_STATUS" ]; then
      sudo systemctl start mysql
    fi
}
# Apache2とMySQLの停止
function stoplamp()
{
    local APACHE2_STATUS=$(sudo systemctl status apache2 | grep "Active:" | grep -ie "running")
    if [ -n "APACHE2_STATUS" ]; then
      sudo systemctl stop apache2
    fi
    local MYSQL8_STATUS=$(sudo systemctl status mysql | grep "Active:" | grep -ie "running")
    if [ -n "MYSQL8_STATUS" ]; then
      sudo systemctl stop mysql
    fi
  }
  }
   
   

案内メニュー