删除过时的文件
This commit is contained in:
parent
46ce1853f9
commit
0f626be4d5
@ -1,55 +0,0 @@
|
||||
#!/bin/bash
|
||||
setFirewall() {
|
||||
res=`which firewall-cmd 2>/dev/null`
|
||||
if [[ $? -eq 0 ]]; then
|
||||
systemctl status firewalld > /dev/null 2>&1
|
||||
if [[ $? -eq 0 ]];then
|
||||
firewall-cmd --permanent --add-service=http
|
||||
firewall-cmd --permanent --add-service=https
|
||||
if [[ "$PORT" != "443" ]]; then
|
||||
firewall-cmd --permanent --add-port=${PORT}/tcp
|
||||
firewall-cmd --permanent --add-port=${PORT}/udp
|
||||
fi
|
||||
firewall-cmd --reload
|
||||
else
|
||||
nl=`iptables -nL | nl | grep FORWARD | awk '{print $1}'`
|
||||
if [[ "$nl" != "3" ]]; then
|
||||
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
|
||||
if [[ "$PORT" != "443" ]]; then
|
||||
iptables -I INPUT -p tcp --dport ${PORT} -j ACCEPT
|
||||
iptables -I INPUT -p udp --dport ${PORT} -j ACCEPT
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
res=`which iptables 2>/dev/null`
|
||||
if [[ $? -eq 0 ]]; then
|
||||
nl=`iptables -nL | nl | grep FORWARD | awk '{print $1}'`
|
||||
if [[ "$nl" != "3" ]]; then
|
||||
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
|
||||
if [[ "$PORT" != "443" ]]; then
|
||||
iptables -I INPUT -p tcp --dport ${PORT} -j ACCEPT
|
||||
iptables -I INPUT -p udp --dport ${PORT} -j ACCEPT
|
||||
fi
|
||||
fi
|
||||
else
|
||||
res=`which ufw 2>/dev/null`
|
||||
if [[ $? -eq 0 ]]; then
|
||||
res=`ufw status | grep -i inactive`
|
||||
if [[ "$res" = "" ]]; then
|
||||
ufw allow http/tcp
|
||||
ufw allow https/tcp
|
||||
if [[ "$PORT" != "443" ]]; then
|
||||
ufw allow ${PORT}/tcp
|
||||
ufw allow ${PORT}/udp
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
setFirewall
|
||||
@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
HTML_PATH="/tmp/usr/share/nginx/html2"
|
||||
STATIC_HTML_URL="https://github.com/vincent0214/static_html/releases/download/1.0/static_html.zip"
|
||||
|
||||
# 修改nginx默认页面
|
||||
rm -rf ${HTML_PATH}
|
||||
mkdir -p ${HTML_PATH}
|
||||
wget ${STATIC_HTML_URL} -P ${HTML_PATH}
|
||||
unzip -o -d ${HTML_PATH} ${HTML_PATH}/static_html.zip
|
||||
rm ${HTML_PATH}/static_html.zip
|
||||
mv ${HTML_PATH}/static_html/* ${HTML_PATH}/
|
||||
rm -rf ${HTML_PATH}/static_html
|
||||
Loading…
Reference in New Issue
Block a user