linux-tutorial/codes/linux/sys/stop-firewall.sh
2019-10-24 22:00:00 +08:00

24 lines
738 B
Bash
Raw Permalink 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.

#!/usr/bin/env bash
# ---------------------------------------------------------------------------------
# 控制台颜色
BLACK="\033[1;30m"
RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
BLUE="\033[1;34m"
PURPLE="\033[1;35m"
CYAN="\033[1;36m"
RESET="$(tput sgr0)"
# ---------------------------------------------------------------------------------
###################################################################################
# 关闭防火墙
# 参考https://www.cnblogs.com/moxiaoan/p/5683743.html
# @author: Zhang Peng
###################################################################################
systemctl stop firewalld
systemctl disable firewalld
printf "\n${GREEN}<<<<<<<< 已关闭防火墙${RESET}\n"