mirror of
https://github.com/teddysun/across.git
synced 2025-01-19 06:19:35 +08:00
Update wireguard.sh
This commit is contained in:
parent
2695401bc9
commit
d9f6fab4ea
@ -339,9 +339,9 @@ enable_ip_forward() {
|
|||||||
set_firewall() {
|
set_firewall() {
|
||||||
_info "Setting firewall rules"
|
_info "Setting firewall rules"
|
||||||
if _exists "firewall-cmd"; then
|
if _exists "firewall-cmd"; then
|
||||||
if [ "$(firewall-cmd --state)" = "running" ]; then
|
if [ "$(firewall-cmd --state | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g")" = "running" ]; then
|
||||||
default_zone="$(firewall-cmd --get-default-zone)"
|
default_zone="$(firewall-cmd --get-default-zone)"
|
||||||
if [ "$(firewall-cmd --zone=${default_zone} --query-masquerade)" = "no" ]; then
|
if [ "$(firewall-cmd --zone=${default_zone} --query-masquerade | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g")" = "no" ]; then
|
||||||
_error_detect "firewall-cmd --zone=${default_zone} --add-masquerade"
|
_error_detect "firewall-cmd --zone=${default_zone} --add-masquerade"
|
||||||
fi
|
fi
|
||||||
if ! firewall-cmd --list-ports | grep -qw "${SERVER_WG_PORT}/udp"; then
|
if ! firewall-cmd --list-ports | grep -qw "${SERVER_WG_PORT}/udp"; then
|
||||||
@ -648,4 +648,4 @@ main() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user