惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
宝玉的分享
宝玉的分享
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
博客园 - 【当耐特】
小众软件
小众软件
博客园 - Franky
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
雷峰网
雷峰网
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Last Week in AI
Last Week in AI
博客园_首页
月光博客
月光博客
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Webroot Blog
Webroot Blog
Stack Overflow Blog
Stack Overflow Blog
腾讯CDC
云风的 BLOG
云风的 BLOG
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Recent Commits to openclaw:main
Recent Commits to openclaw:main
D
Docker
The Last Watchdog
The Last Watchdog
有赞技术团队
有赞技术团队
Hacker News - Newest:
Hacker News - Newest: "LLM"
D
DataBreaches.Net
S
Security @ Cisco Blogs
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
TaoSecurity Blog
TaoSecurity Blog
S
Security Affairs
Y
Y Combinator Blog
O
OpenAI News
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
K
Kaspersky official blog
Cloudbric
Cloudbric

博客园 - 泡面 @ 幸福

nodejs&wsl&vscode&docker开发环境搭建 python中list数组指定类型 windows10安装Trading View出错解决办法 windows or linux 64位安装ta-lib包 在centos7开启SSH服务 在centos7升级nodejs到最新版本 一张自画的RBAC用户、组、角色、权限、指令、资源图 JSON树形格式从子级获取所有父级ID JSON数据格式生成无限级树结构 MYSQL查询上级和下级 码云push时提示 DeployKey does not support push code fatal: Could not read from remote repository. git常用命令 thinkjs框架发布上线PM2管理,静态资源访问配置 登陆服务器提示“You need to run "nvm install N/A" to install it before using it.” CentOS 7.X 安全手记 Centos 7.x nginx隐藏版本号 centos7磁盘挂载及取消 CentOS 7.4上网速度慢,修改DNS! Centos7.4 安装Docker
CentOS 7.x 用shell增加、删除端口
泡面 @ 幸福 · 2018-12-21 · via 博客园 - 泡面 @ 幸福

一、在/usr/local/sbin/下创建port文件,不要扩展名,并给权限  chom 777 port

#!/bin/bash
num=$#
ok=0
if [ ${num} == 1 ]; then
	if [ $1 == 'list' ]; then
	    firewall-cmd --zone=public --list-ports
    		exit 0
	fi
fi

if [ ${num} != 2 ]; then
    echo 'error:you must input two parmas, first is add or remote, second is port number'
    exit 0
fi

case $1 in

add)
firewall-cmd --zone=public --add-port=$2/tcp --permanent
#firewall-cmd --zone=public --add-port=$2/udp --permanent
ok=1
;;

remove)
firewall-cmd --zone=public --remove-port=$2/tcp --permanent
#firewall-cmd --zone=public --remove-port=$2/udp --permanent
ok=1
;;

*)
echo 'first params must be "add" or "remove"' 
;;

esac
if [ ${ok} == 1 ]; then
firewall-cmd --reload
firewall-cmd --zone=public --list-all
fi
exit 0

  二、用法

  #port add 8080

  #port remove 8080

  #port list