@@ -15,20 +15,20 @@ update_os
1515
1616msg_info " Installing Dependencies"
1717$STD apk add \
18- newt \
19- curl \
20- openssh \
21- nano \
22- mc \
23- gpg \
24- iptables \
25- openrc
18+ newt \
19+ curl \
20+ openssh \
21+ nano \
22+ mc \
23+ gpg \
24+ iptables \
25+ openrc
2626msg_ok " Installed Dependencies"
2727
2828msg_info " Installing WireGuard"
2929$STD apk add --no-cache wireguard-tools
3030if [[ ! -L /etc/init.d/wg-quick.wg0 ]]; then
31- ln -s /etc/init.d/wg-quick /etc/init.d/wg-quick.wg0
31+ ln -s /etc/init.d/wg-quick /etc/init.d/wg-quick.wg0
3232fi
3333
3434private_key=$( wg genkey)
@@ -41,32 +41,33 @@ PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACC
4141PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
4242ListenPort = 51820
4343EOF
44+ echo " net.ipv4.ip_forward=1" >> /etc/sysctl.conf
45+ $STD rc-update add sysctl
46+ $STD sysctl -p /etc/sysctl.conf
4447msg_ok " Installed WireGuard"
4548
4649read -rp " Do you want to install WGDashboard? (y/N): " INSTALL_WGD
4750if [[ " $INSTALL_WGD " =~ ^[Yy]$ ]]; then
48- msg_info " Installing additional dependencies for WGDashboard"
49- $STD apk add --no-cache \
50- python3 \
51- py3-pip \
52- git \
53- sudo \
54- musl-dev \
55- linux-headers \
56- gcc \
57- python3-dev
58- msg_ok " Installed additional dependencies for WGDashboard"
59- msg_info " Installing WGDashboard"
60- git clone -q https://github.com/donaldzou/WGDashboard.git /etc/wgdashboard
61- cd /etc/wgdashboard/src || exit
62- chmod u+x wgd.sh
63- $STD ./wgd.sh install
64- $STD echo " net.ipv4.ip_forward=1" >> /etc/sysctl.conf
65- sysctl -p /etc/sysctl.conf
66- msg_ok " Installed WGDashboard"
51+ msg_info " Installing additional dependencies for WGDashboard"
52+ $STD apk add --no-cache \
53+ python3 \
54+ py3-pip \
55+ git \
56+ sudo \
57+ musl-dev \
58+ linux-headers \
59+ gcc \
60+ python3-dev
61+ msg_ok " Installed additional dependencies for WGDashboard"
62+ msg_info " Installing WGDashboard"
63+ git clone -q https://github.com/donaldzou/WGDashboard.git /etc/wgdashboard
64+ cd /etc/wgdashboard/src || exit
65+ chmod u+x wgd.sh
66+ $STD ./wgd.sh install
67+ msg_ok " Installed WGDashboard"
6768
68- msg_info " Creating Service for WGDashboard"
69- cat << EOF >/etc/init.d/wg-dashboard
69+ msg_info " Creating Service for WGDashboard"
70+ cat << EOF >/etc/init.d/wg-dashboard
7071#!/sbin/openrc-run
7172
7273description="WireGuard Dashboard Service"
@@ -89,10 +90,10 @@ stop() {
8990 eend $?
9091}
9192EOF
92- chmod +x /etc/init.d/wg-dashboard
93- $STD rc-update add wg-dashboard default
94- $STD rc-service wg-dashboard start
95- msg_ok " Created Service for WGDashboard"
93+ chmod +x /etc/init.d/wg-dashboard
94+ $STD rc-update add wg-dashboard default
95+ $STD rc-service wg-dashboard start
96+ msg_ok " Created Service for WGDashboard"
9697
9798fi
9899
0 commit comments