linuxtool/Config/Web/nginx/test.sh

17 lines
415 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
if ! command -v nginx &> /dev/null; then
if [[ -f "/usr/bin/apt-get" ]];then
apt-get update -y
apt-get install nginx -y
elif [[ -f "/usr/bin/apt" ]];then
apt update -y
apt install nginx -y
elif [[ -f "/usr/bin/pacman" ]];then
pacman -Syu --noconfirm
pacman -Sy --noconfirm nginx
else
echo "nginx未安装请手动安装"
exit
fi
fi