Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
M3chD09 committed Mar 1, 2020
1 parent 86094db commit f215868
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 11 additions & 7 deletions centos-ss-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,19 @@ WantedBy=multi-user.target
EOF
}

firewall_conf(){
systemctl status firewalld > /dev/null 2>&1
if [ $? -eq 0 ]; then
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
fi
}

get_cert(){
if [ -f /etc/letsencrypt/live/$domain/fullchain.pem ];then
echo -e "\033[1;32mcert already got, skip.\033[0m"
else
systemctl status firewalld > /dev/null 2>&1
if [ $? -eq 0 ]; then
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-port=443/tcp
firewall-cmd --permanent --zone=public --add-port=443/udp
firewall-cmd --reload
fi
yum install -y certbot
certbot certonly --cert-name $domain -d $domain --standalone --agree-tos --register-unsafely-without-email
systemctl enable certbot-renew.timer
Expand Down Expand Up @@ -224,6 +226,7 @@ install_all(){
install_ss
install_v2
ss_conf
firewall_conf
get_cert
start_ss
remove_files
Expand Down Expand Up @@ -262,6 +265,7 @@ echo "What do you want to do?"
echo "[1] Install"
echo "[2] Remove"
read -p "(Default option: Install):" option
option=${option:-1}
if [ $option -eq 2 ];then
remove_all
else
Expand Down
1 change: 1 addition & 0 deletions ubuntu-ss-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ echo "What do you want to do?"
echo "[1] Install"
echo "[2] Remove"
read -p "(Default option: Install):" option
option=${option:-1}
if [ $option -eq 2 ];then
remove_all
else
Expand Down

0 comments on commit f215868

Please sign in to comment.