mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-04-19 01:38:07 +00:00
Alpine-Wireguard: Fix for sysctl and ip_forward (#3744)
* moved ip forwarding to wireguard install and removed silent before echo command, testing if this was a bug * Adding $STD before echo command * Update install/alpine-wireguard-install.sh Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> --------- Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
This commit is contained in:
parent
9ef7ad5d2a
commit
542f93437a
@ -15,20 +15,20 @@ update_os
|
|||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apk add \
|
$STD apk add \
|
||||||
newt \
|
newt \
|
||||||
curl \
|
curl \
|
||||||
openssh \
|
openssh \
|
||||||
nano \
|
nano \
|
||||||
mc \
|
mc \
|
||||||
gpg \
|
gpg \
|
||||||
iptables \
|
iptables \
|
||||||
openrc
|
openrc
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Installing WireGuard"
|
msg_info "Installing WireGuard"
|
||||||
$STD apk add --no-cache wireguard-tools
|
$STD apk add --no-cache wireguard-tools
|
||||||
if [[ ! -L /etc/init.d/wg-quick.wg0 ]]; then
|
if [[ ! -L /etc/init.d/wg-quick.wg0 ]]; then
|
||||||
ln -s /etc/init.d/wg-quick /etc/init.d/wg-quick.wg0
|
ln -s /etc/init.d/wg-quick /etc/init.d/wg-quick.wg0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
private_key=$(wg genkey)
|
private_key=$(wg genkey)
|
||||||
@ -41,32 +41,33 @@ PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACC
|
|||||||
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
|
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
|
||||||
ListenPort = 51820
|
ListenPort = 51820
|
||||||
EOF
|
EOF
|
||||||
|
echo "net.ipv4.ip_forward=1" >>/etc/sysctl.conf
|
||||||
|
$STD rc-update add sysctl
|
||||||
|
$STD sysctl -p /etc/sysctl.conf
|
||||||
msg_ok "Installed WireGuard"
|
msg_ok "Installed WireGuard"
|
||||||
|
|
||||||
read -rp "Do you want to install WGDashboard? (y/N): " INSTALL_WGD
|
read -rp "Do you want to install WGDashboard? (y/N): " INSTALL_WGD
|
||||||
if [[ "$INSTALL_WGD" =~ ^[Yy]$ ]]; then
|
if [[ "$INSTALL_WGD" =~ ^[Yy]$ ]]; then
|
||||||
msg_info "Installing additional dependencies for WGDashboard"
|
msg_info "Installing additional dependencies for WGDashboard"
|
||||||
$STD apk add --no-cache \
|
$STD apk add --no-cache \
|
||||||
python3 \
|
python3 \
|
||||||
py3-pip \
|
py3-pip \
|
||||||
git \
|
git \
|
||||||
sudo \
|
sudo \
|
||||||
musl-dev \
|
musl-dev \
|
||||||
linux-headers \
|
linux-headers \
|
||||||
gcc \
|
gcc \
|
||||||
python3-dev
|
python3-dev
|
||||||
msg_ok "Installed additional dependencies for WGDashboard"
|
msg_ok "Installed additional dependencies for WGDashboard"
|
||||||
msg_info "Installing WGDashboard"
|
msg_info "Installing WGDashboard"
|
||||||
git clone -q https://github.com/donaldzou/WGDashboard.git /etc/wgdashboard
|
git clone -q https://github.com/donaldzou/WGDashboard.git /etc/wgdashboard
|
||||||
cd /etc/wgdashboard/src || exit
|
cd /etc/wgdashboard/src || exit
|
||||||
chmod u+x wgd.sh
|
chmod u+x wgd.sh
|
||||||
$STD ./wgd.sh install
|
$STD ./wgd.sh install
|
||||||
$STD echo "net.ipv4.ip_forward=1" >>/etc/sysctl.conf
|
msg_ok "Installed WGDashboard"
|
||||||
sysctl -p /etc/sysctl.conf
|
|
||||||
msg_ok "Installed WGDashboard"
|
|
||||||
|
|
||||||
msg_info "Creating Service for WGDashboard"
|
msg_info "Creating Service for WGDashboard"
|
||||||
cat <<EOF >/etc/init.d/wg-dashboard
|
cat <<EOF >/etc/init.d/wg-dashboard
|
||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
description="WireGuard Dashboard Service"
|
description="WireGuard Dashboard Service"
|
||||||
@ -89,10 +90,10 @@ stop() {
|
|||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
chmod +x /etc/init.d/wg-dashboard
|
chmod +x /etc/init.d/wg-dashboard
|
||||||
$STD rc-update add wg-dashboard default
|
$STD rc-update add wg-dashboard default
|
||||||
$STD rc-service wg-dashboard start
|
$STD rc-service wg-dashboard start
|
||||||
msg_ok "Created Service for WGDashboard"
|
msg_ok "Created Service for WGDashboard"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user