Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
#!/bin/bash
2
 
3
#
4
#	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
5
#    Copyright (C) 2015~2024 Min-Jhin,Chen
6
#
7
#    This file is part of QBPWCF.
8
#
9
#    QBPWCF is free software: you can redistribute it and/or modify
10
#    it under the terms of the GNU General Public License as published by
11
#    the Free Software Foundation, either version 3 of the License, or
12
#    (at your option) any later version.
13
#
14
#    QBPWCF is distributed in the hope that it will be useful,
15
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
#    GNU General Public License for more details.
18
#
19
#    You should have received a copy of the GNU General Public License
20
#    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
21
#   
22
 
23
#comment run in root
24
echo "Please run in root";
25
 
26
#get ip to block
27
read -p 'Please Enter IP which should be unblocked:' ip;
28
 
29
#check ip repeated
30
ip_repeated=`firewall-cmd --list-all | grep ${ip} | wc -l`;
31
 
32
if [ ${ip_repeated} == 1 ];then
33
 
34
	#unblock ip & reload firewall
35
	firewall-cmd --permanent --remove-rich-rule="rule family=ipv4 source address=${ip} reject";
36
	firewall-cmd --complete-reload;
37
 
38
	#comment is unblocked
39
	echo "${ip} is unblocked.";
40
else
41
	#comment is unblocked
42
	echo "${ip} is unblocked.";
43
fi