1
0
espelhamento de https://github.com/angristan/openvpn-install.git sincronizado 2025-07-12 09:24:22 +02:00

Merge 2b73d5e1a442cb74c55fc8c0f7d873918b208bcd into 7e32f6ae8373fe66e657cb693518c45768d0ea6e

Esse commit está contido em:
StrajnarFilip 2025-03-21 21:13:58 +05:00 commit de GitHub
commit 7b4a316614
Nenhuma chave conhecida encontrada para esta assinatura no banco de dados
ID da chave GPG: B5690EEEBB952194

Ver arquivo

@ -355,6 +355,27 @@ function installQuestions() {
PROTOCOL="tcp" PROTOCOL="tcp"
;; ;;
esac esac
if command -v "firewall-cmd" &> /dev/null
then
SUGGESTION=y
echo "Command \"firewall-cmd\" has been detected."
until [[ $ADDPORT =~ (y|n) ]]; do
read -rp "Would you like to open port ${PORT} on firewalld? [y/n]: " -e -i $SUGGESTION ADDPORT
done
if [[ $ADDPORT == "y" ]]; then
firewall-cmd --add-port "${PORT}"/"${PROTOCOL}"
firewall-cmd --permanent --add-port "${PORT}"/"${PROTOCOL}"
fi
fi
echo ""
echo "Option client-to-client allows clients to \"see\" eachother."
echo "Would you like to enable this option?"
SUGGESTION=y
until [[ $CLIENT_TO_CLIENT_OPTION =~ (y|n) ]]; do
read -rp "Enable client-to-client? [y/n]: " -e -i $SUGGESTION CLIENT_TO_CLIENT_OPTION
done
echo "" echo ""
echo "What DNS resolvers do you want to use with the VPN?" echo "What DNS resolvers do you want to use with the VPN?"
echo " 1) Current system resolvers (from /etc/resolv.conf)" echo " 1) Current system resolvers (from /etc/resolv.conf)"
@ -669,6 +690,8 @@ function installOpenVPN() {
CLIENT=${CLIENT:-client} CLIENT=${CLIENT:-client}
PASS=${PASS:-1} PASS=${PASS:-1}
CONTINUE=${CONTINUE:-y} CONTINUE=${CONTINUE:-y}
CLIENT_TO_CLIENT_OPTION="y"
ADDPORT="y"
if [[ -z $ENDPOINT ]]; then if [[ -z $ENDPOINT ]]; then
ENDPOINT=$(resolvePublicIP) ENDPOINT=$(resolvePublicIP)
@ -814,6 +837,10 @@ function installOpenVPN() {
echo "proto ${PROTOCOL}6" >>/etc/openvpn/server.conf echo "proto ${PROTOCOL}6" >>/etc/openvpn/server.conf
fi fi
if [[ $CLIENT_TO_CLIENT_OPTION == "y" ]]; then
echo "client-to-client" >>/etc/openvpn/server.conf
fi
echo "dev tun echo "dev tun
user nobody user nobody
group $NOGROUP group $NOGROUP