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
47505558cc
commit
9fbd771d99
23
wireguard.sh
23
wireguard.sh
@ -547,6 +547,7 @@ set_firewall() {
|
|||||||
_warn "systemctl start firewalld"
|
_warn "systemctl start firewalld"
|
||||||
_warn "firewall-cmd --permanent --zone=public --add-masquerade"
|
_warn "firewall-cmd --permanent --zone=public --add-masquerade"
|
||||||
_warn "firewall-cmd --permanent --zone=public --add-port=${SERVER_WG_PORT}/udp"
|
_warn "firewall-cmd --permanent --zone=public --add-port=${SERVER_WG_PORT}/udp"
|
||||||
|
_warn "firewall-cmd --reload"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if _exists "iptables"; then
|
if _exists "iptables"; then
|
||||||
@ -585,13 +586,13 @@ install_completed() {
|
|||||||
_error_detect "systemctl start wg-quick@${SERVER_WG_NIC}"
|
_error_detect "systemctl start wg-quick@${SERVER_WG_NIC}"
|
||||||
_error_detect "systemctl enable wg-quick@${SERVER_WG_NIC}"
|
_error_detect "systemctl enable wg-quick@${SERVER_WG_NIC}"
|
||||||
_info "WireGuard VPN Server installation completed"
|
_info "WireGuard VPN Server installation completed"
|
||||||
echo
|
_info ""
|
||||||
_info "WireGuard VPN default client file is below:"
|
_info "WireGuard VPN default client file is below:"
|
||||||
_info "$(_green "/etc/wireguard/${SERVER_WG_NIC}_client")"
|
_info "$(_green "/etc/wireguard/${SERVER_WG_NIC}_client")"
|
||||||
echo
|
_info ""
|
||||||
_info "WireGuard VPN default client QR Code is below:"
|
_info "WireGuard VPN default client QR Code is below:"
|
||||||
_info "$(_green "/etc/wireguard/${SERVER_WG_NIC}_client.png")"
|
_info "$(_green "/etc/wireguard/${SERVER_WG_NIC}_client.png")"
|
||||||
echo
|
_info ""
|
||||||
_info "Download and scan this QR Code with your device"
|
_info "Download and scan this QR Code with your device"
|
||||||
_info "Welcome to visit: https://teddysun.com/554.html"
|
_info "Welcome to visit: https://teddysun.com/554.html"
|
||||||
_info "Enjoy it"
|
_info "Enjoy it"
|
||||||
@ -797,8 +798,12 @@ install_from_repo() {
|
|||||||
if [ ${rt} -eq 0 ]; then
|
if [ ${rt} -eq 0 ]; then
|
||||||
_red "WireGuard was already installed\n" && exit 0
|
_red "WireGuard was already installed\n" && exit 0
|
||||||
fi
|
fi
|
||||||
if check_kernel_version && [ ${rt} -eq 2 ]; then
|
if check_kernel_version; then
|
||||||
install_wg_3
|
if [ ${rt} -eq 2 ]; then
|
||||||
|
install_wg_3
|
||||||
|
else
|
||||||
|
_error "WireGuard module does not exists, please check your kernel"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
install_wg_1
|
install_wg_1
|
||||||
fi
|
fi
|
||||||
@ -817,8 +822,12 @@ install_from_source() {
|
|||||||
if [ ${rt} -eq 0 ]; then
|
if [ ${rt} -eq 0 ]; then
|
||||||
_red "WireGuard was already installed\n" && exit 0
|
_red "WireGuard was already installed\n" && exit 0
|
||||||
fi
|
fi
|
||||||
if check_kernel_version && [ ${rt} -eq 2 ]; then
|
if check_kernel_version; then
|
||||||
install_wg_4
|
if [ ${rt} -eq 2 ]; then
|
||||||
|
install_wg_4
|
||||||
|
else
|
||||||
|
_error "WireGuard module does not exists, please check your kernel"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
install_wg_2
|
install_wg_2
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user