标签:tool font quick link table tab numbers 输入 ida
#!/bin/bash echo_caidan() { # 清空防火墙规则 read -ep "是否清空防火墙规则(y/n):" name if [ $name == y ];then iptables -F echo " 1) 放行端口 2) 封锁端口 3) 放行ip 4) 封锁ip " else echo " 1) 放行端口 2) 封锁端口 3) 放行ip 4) 封锁ip " fi } IF(){ while : do read -ep "是否继续输入:(y/n):" y_n if [ $y_n == y ];then break elif [ $y_n == n ];then exit else echo "输入错误,从新输入" fi done } # 函数 DKF() { read -p "输入要放行的端口:" dk_f echo "正在放行..." iptables -I INPUT -p tcp --dport $dk_f -j ACCEPT echo "提示: $dk_f 端口放行规则添加完毕" } DKS() { read -p "输入要封锁的端口:" dk_s echo "正在封锁..." iptables -I INPUT -p tcp --dport $dk_s -j DROP echo "提示: $dk_f 端口封锁规则添加完毕" } IPF() { read -p "请输入要放行的IP:" ip_f echo "正在放行..." iptables -I INPUT -s $ip_f -j ACCEPT echo "提示: $ip_f 放行规则添加完毕" } IPS() { read -p "请输入要封锁的IP:" ip_s echo "正在放行..." iptables -I INPUT -s $ip_s -j DROP echo "提示: $ip_s 封锁规则添加完毕" } #输出函数 echo_caidan # 操作执行函数 read -p "请选择你的操作:" zuo case $zuo in 1) while : do DKF IF done ;; 2) while : do DKS IF done ;; 3) while : do IPF IF done ;; 4) while : do IPS IF done ;; *) echo "输入有误,退出脚本" esac
标签:tool font quick link table tab numbers 输入 ida
原文地址:https://www.cnblogs.com/sunjianlin/p/13253303.html