centos7 编写防火墙增加和删除端口脚本
来源:互联网 发布:js判断只能输入数字 编辑:程序博客网 时间:2024/06/11 08:29
#!/bin/bashnum=$#ok=0if [ ${num} != 2 ]then echo 'error:you must input two parmas, first is add or remove, second is port number' exit 0ficase $1 in add) status=$(firewall-cmd --zone=public --add-port=$2/tcp --permanent) echo "add port status:${status}" ok=1;;remove) status=$(firewall-cmd --zone=public --remove-port=$2/tcp --permanent) echo "remove port status:${status}" ok=1;;*) echo 'you must input two parmas, first is add or remove';;esacif [ ${ok} == 1 ]then status=`firewall-cmd --reload` echo "reload firewall status:${status}" ports=`firewall-cmd --list-ports` echo "ports list:${ports}"fiexit 0
阅读全文
0 0
- centos7 编写防火墙增加和删除端口脚本
- CentOS7一键增加删除防火墙端口
- CentOS7.2增加和更换ssh端口
- Centos7 防火墙开放端口
- centos7 开放防火墙端口
- centos7防火墙开放端口
- CentOS7防火墙放行端口
- centos7开启防火墙端口
- CentOS7 防火墙 开放端口
- linux 防火墙增加端口
- 关闭selinux和防火墙开启状态增加3306端口
- Centos7.1防火墙开放端口
- Centos7.1防火墙开放端口
- Centos7 关闭防火墙,过滤端口
- centos7防火墙开放80端口
- Centos7,配置防火墙,开启端口
- centos7防火墙端口的开启
- Centos7 关闭防火墙,过滤端口
- 《DOS命令一日通》第七章 管道命令与DOS过滤器
- HTML 规范
- window对象下获取的屏幕宽高
- IntelliJ IDEA中实现SpringBoot热部署
- Android 收藏&笔记
- centos7 编写防火墙增加和删除端口脚本
- Codevs1995黑魔法师之门
- Linux软件安装管理(一)
- SylixOS日志子系统简介
- linux下查看监听端口对应的进程
- 挖掘一线IT工作者,创造行业标杆
- 单向循环链表的基本操作
- jquery验证
- eclipse 闪退处理方法