mirror of
https://github.com/Ysurac/openmptcprouter-vps.git
synced 2025-02-12 11:21:56 +00:00
Add kernel 6.6 support, allow to disable all proxy and VPNs, change IPv6 address in omr-pihole
This commit is contained in:
parent
0bd93fb5c8
commit
001aa3be4d
2 changed files with 313 additions and 265 deletions
|
@ -6,8 +6,11 @@
|
|||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
KERNEL=${KERNEL:-5.4}
|
||||
UPSTREAM=${UPSTREAM:-no}
|
||||
[ "$UPSTREAM" = "yes" ] && KERNEL="5.15"
|
||||
UPSTREAM6=${UPSTREAM6:-no}
|
||||
[ "$UPSTREAM6" = "yes" ] && KERNEL="6.1"
|
||||
SHADOWSOCKS_PASS=${SHADOWSOCKS_PASS:-$(head -c 32 /dev/urandom | base64 -w0)}
|
||||
GLORYTUN_PASS=${GLORYTUN_PASS:-$(od -vN "32" -An -tx1 /dev/urandom | tr '[:lower:]' '[:upper:]' | tr -d " \n")}
|
||||
DSVPN_PASS=${DSVPN_PASS:-$(od -vN "32" -An -tx1 /dev/urandom | tr '[:lower:]' '[:upper:]' | tr -d " \n")}
|
||||
|
@ -19,6 +22,7 @@ V2RAY=${V2RAY:-yes}
|
|||
V2RAY_UUID=${V2RAY_UUID:-$(cat /proc/sys/kernel/random/uuid | tr -d "\n")}
|
||||
XRAY=${XRAY:-yes}
|
||||
XRAY_UUID=${XRAY_UUID:-$V2RAY_UUID}
|
||||
SHADOWSOCKS=${SHADOWSOCKS:-yes}
|
||||
SHADOWSOCKS_GO=${SHADOWSOCKS_GO:-yes}
|
||||
PSK=${PSK:-$(head -c 32 /dev/urandom | base64 -w0)}
|
||||
UPSK=${UPSK:-$(head -c 32 /dev/urandom | base64 -w0)}
|
||||
|
@ -36,7 +40,7 @@ OPENVPN=${OPENVPN:-yes}
|
|||
DSVPN=${DSVPN:-yes}
|
||||
WIREGUARD=${WIREGUARD:-yes}
|
||||
SOURCES=${SOURCES:-no}
|
||||
if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" ]; then
|
||||
if [ "$KERNEL" != "5.4" ]; then
|
||||
SOURCES="yes"
|
||||
fi
|
||||
NOINTERNET=${NOINTERNET:-no}
|
||||
|
@ -48,18 +52,20 @@ INTERFACE=${INTERFACE:-$(ip -o -4 route show to default | grep -m 1 -Po '(?<=dev
|
|||
KERNEL_VERSION="5.4.207"
|
||||
KERNEL_PACKAGE_VERSION="1.22"
|
||||
KERNEL_RELEASE="${KERNEL_VERSION}-mptcp_${KERNEL_PACKAGE_VERSION}"
|
||||
if [ "$UPSTREAM" = "yes" ]; then
|
||||
if [ "$KERNEL" = "5.15" ]; then
|
||||
KERNEL_VERSION="5.15.57"
|
||||
KERNEL_PACKAGE_VERSION="1.6"
|
||||
KERNEL_RELEASE="${KERNEL_VERSION}-mptcp_${KERNEL_VERSION}-${KERNEL_PACKAGE_VERSION}"
|
||||
fi
|
||||
if [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" = "6.1" ]; then
|
||||
KERNEL_VERSION="6.1.0"
|
||||
KERNEL_PACKAGE_VERSION="1.30"
|
||||
KERNEL_RELEASE="${KERNEL_VERSION}-mptcp_${KERNEL_PACKAGE_VERSION}"
|
||||
fi
|
||||
GLORYTUN_UDP=${GLORYTUN_UDP:-yes}
|
||||
GLORYTUN_UDP_VERSION="23100474922259d00a8c0c4b00a0c8de89202cf9"
|
||||
GLORYTUN_UDP_BINARY_VERSION="0.3.4-5"
|
||||
GLORYTUN_TCP=${GLORYTUN_TCP:-yes}
|
||||
GLORYTUN_TCP_BINARY_VERSION="0.0.35-6"
|
||||
#MLVPN_VERSION="8f9720978b28c1954f9f229525333547283316d2"
|
||||
MLVPN_VERSION="8aa1b16d843ea68734e2520e39a34cb7f3d61b2b"
|
||||
|
@ -67,8 +73,8 @@ MLVPN_BINARY_VERSION="3.0.0+20211028.git.ddafba3"
|
|||
UBOND_VERSION="31af0f69ebb6d07ed9348dca2fced33b956cedee"
|
||||
OBFS_VERSION="486bebd9208539058e57e23a12f23103016e09b4"
|
||||
OBFS_BINARY_VERSION="0.0.5-1"
|
||||
OMR_ADMIN_VERSION="0780292d156cd8c00cbc83e1ca7d1ff3fde7cf5c"
|
||||
OMR_ADMIN_BINARY_VERSION="0.8+20240213"
|
||||
OMR_ADMIN_VERSION="a30f1f32461aefcdb47851d533439032af6e4b05"
|
||||
OMR_ADMIN_BINARY_VERSION="0.9+20240222"
|
||||
#OMR_ADMIN_BINARY_VERSION="0.3+20220827"
|
||||
DSVPN_VERSION="3b99d2ef6c02b2ef68b5784bec8adfdd55b29b1a"
|
||||
DSVPN_BINARY_VERSION="0.1.4-2"
|
||||
|
@ -126,12 +132,12 @@ fi
|
|||
|
||||
echo "Check architecture..."
|
||||
ARCH=$(dpkg --print-architecture | tr -d "\n")
|
||||
if [ "$UPSTREAM6" != "yes" ] && [ "$ARCH" != "amd64" ] && [ "$ID" != "debian" ]; then
|
||||
if ([ "$KERNEL" = "5.4" ] || [ "$KERNEL" = "5.15" ]) && [ "$ARCH" != "amd64" ] && [ "$ID" != "debian" ]; then
|
||||
echo "Only x86_64 (amd64) is supported on this OS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$UPSTREAM6" != "yes" ]; then
|
||||
if [ "$KERNEL" = "5.4" ] || [ "$KERNEL" = "5.15" ]; then
|
||||
echo "Check virtualized environment"
|
||||
VIRT="$(systemd-detect-virt 2>/dev/null || true)"
|
||||
if [ -z "$(uname -a | grep mptcp)" ] && [ -n "$VIRT" ] && ([ "$VIRT" = "openvz" ] || [ "$VIRT" = "lxc" ] || [ "$VIRT" = "docker" ]); then
|
||||
|
@ -225,7 +231,7 @@ if [ "$ID" = "debian" ] && [ "$VERSION_ID" = "9" ] && [ "$UPDATE_OS" = "yes" ];
|
|||
apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" dist-upgrade
|
||||
VERSION_ID="10"
|
||||
fi
|
||||
if [ "$ID" = "debian" ] && [ "$VERSION_ID" = "10" ] && [ "$UPDATE_OS" = "yes" ] && [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$ID" = "debian" ] && [ "$VERSION_ID" = "10" ] && [ "$UPDATE_OS" = "yes" ] && ([ "$KERNEL" = "6.1" ] || [ "$KERNEL" = "6.6" ]); then
|
||||
echo "Update Debian 10 Stretch to Debian 11 Buster"
|
||||
apt-get -y -f --force-yes upgrade
|
||||
apt-get -y -f --force-yes dist-upgrade
|
||||
|
@ -236,7 +242,7 @@ if [ "$ID" = "debian" ] && [ "$VERSION_ID" = "10" ] && [ "$UPDATE_OS" = "yes" ]
|
|||
apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" dist-upgrade
|
||||
VERSION_ID="11"
|
||||
fi
|
||||
if [ "$ID" = "debian" ] && [ "$VERSION_ID" = "11" ] && [ "$UPDATE_OS" = "yes" ] && [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$ID" = "debian" ] && [ "$VERSION_ID" = "11" ] && [ "$UPDATE_OS" = "yes" ] && ([ "$KERNEL" = "6.1" ] || [ "$KERNEL" = "6.6" ]); then
|
||||
echo "Update Debian 11 Buster to Debian 12"
|
||||
apt-get -y -f --force-yes upgrade
|
||||
apt-get -y -f --force-yes dist-upgrade
|
||||
|
@ -256,7 +262,7 @@ if [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "18.04" ] && [ "$UPDATE_OS" = "yes"
|
|||
apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" dist-upgrade
|
||||
VERSION_ID="20.04"
|
||||
fi
|
||||
if [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "18.04" ] && [ "$UPDATE_OS" = "yes" ] && [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "18.04" ] && [ "$UPDATE_OS" = "yes" ] && ([ "$KERNEL" = "6.1" ] || [ "$KERNEL" = "6.6" ]); then
|
||||
echo "Update Ubuntu 20.04 to Ubuntu 22.04"
|
||||
apt-get -y -f --force-yes upgrade
|
||||
apt-get -y -f --force-yes dist-upgrade
|
||||
|
@ -377,7 +383,7 @@ if [ -z "$(dpkg-query -l | grep grub)" ]; then
|
|||
echo 'GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"' > /etc/default/grub
|
||||
}
|
||||
fi
|
||||
if [ "$UPSTREAM6" != "yes" ]; then
|
||||
if [ "$KERNEL" = "5.4" ] || [ "$KERNEL" = "5.15" ]; then
|
||||
if [ "$SOURCES" = "yes" ]; then
|
||||
wget -O /tmp/linux-image-${KERNEL_RELEASE}_amd64.deb ${VPSURL}kernel/linux-image-${KERNEL_RELEASE}_amd64.deb
|
||||
wget -O /tmp/linux-headers-${KERNEL_RELEASE}_amd64.deb ${VPSURL}kernel/linux-headers-${KERNEL_RELEASE}_amd64.deb
|
||||
|
@ -418,6 +424,15 @@ if [ "$UPSTREAM6" != "yes" ]; then
|
|||
bash update-grub.sh ${KERNEL_VERSION}-mptcp
|
||||
bash update-grub.sh ${KERNEL_RELEASE}
|
||||
[ -f /boot/grub/grub.cfg ] && sed -i 's/default="1>0"/default="0"/' /boot/grub/grub.cfg 2>&1 >/dev/null
|
||||
elif [ "$KERNEL" = "6.6" ] && [ "$ARCH" = "amd64" ]; then
|
||||
wget https://dl.xanmod.org/archive.key -O /etc/apt/trusted.gpg.d/xanmod.gpg
|
||||
echo 'deb http://deb.xanmod.org releases main' > /etc/apt/sources.list.d/xanmod-release.list
|
||||
apt-get update
|
||||
apt-get -y install linux-xanmod-x64v3
|
||||
[ -f /etc/default/grub ] && {
|
||||
sed -i "s@^\(GRUB_DEFAULT=\).*@\1\"0\"@" /etc/default/grub >/dev/null 2>&1
|
||||
[ -f /boot/grub/grub.cfg ] && grub-mkconfig -o /boot/grub/grub.cfg >/dev/null 2>&1
|
||||
}
|
||||
else
|
||||
if [ "$ID" = "ubuntu" ] && [ -z "$(uname -a | grep '6.1')" ]; then
|
||||
apt-get -y install $(apt-cache search linux-image-unsigned-6.1.0 | tail -n 1 | cut -d" " -f1)
|
||||
|
@ -447,7 +462,7 @@ if [ "$IPERF" = "yes" ]; then
|
|||
echo "openmptcprouter,$IPERFPASS" > /etc/iperf3/users.csv
|
||||
fi
|
||||
chown -Rf iperf3 /etc/iperf3 || true
|
||||
systemctl enable iperf3.service
|
||||
systemctl enable iperf3.service || true
|
||||
mkdir -p /etc/systemd/system/iperf3.service.d
|
||||
if [ "$LOCALFILES" = "no" ]; then
|
||||
wget -O /etc/systemd/system/iperf3.service.d/override.conf ${VPSURL}${VPSPATH}/iperf3.override.conf
|
||||
|
@ -456,7 +471,7 @@ if [ "$IPERF" = "yes" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" != "5.4" ]; then
|
||||
echo "Compile and install mptcpize..."
|
||||
apt-get -y install --no-install-recommends build-essential
|
||||
cd /tmp
|
||||
|
@ -496,7 +511,7 @@ if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]; then
|
|||
fi
|
||||
|
||||
apt-get -y remove shadowsocks-libev
|
||||
|
||||
if [ "$SHADOWSOCKS" = "yes" ]; then
|
||||
if [ "$SOURCES" = "yes" ]; then
|
||||
#apt -t stretch-backports -y install shadowsocks-libev
|
||||
## Compile Shadowsocks
|
||||
|
@ -547,7 +562,6 @@ if [ "$SOURCES" = "yes" ]; then
|
|||
rm -f /var/lib/dpkg/lock
|
||||
rm -f /var/lib/dpkg/lock-frontend
|
||||
systemctl enable haveged
|
||||
|
||||
if [ "$ID" = "debian" ]; then
|
||||
rm -f /var/lib/dpkg/lock
|
||||
rm -f /var/lib/dpkg/lock-frontend
|
||||
|
@ -580,13 +594,14 @@ if [ "$SOURCES" = "yes" ]; then
|
|||
else
|
||||
apt-get -y -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-overwrite" install omr-shadowsocks-libev=${SHADOWSOCKS_BINARY_VERSION}
|
||||
fi
|
||||
fi
|
||||
|
||||
# Load BBR Congestion module at boot time
|
||||
if ! grep -q bbr /etc/modules ; then
|
||||
echo tcp_bbr >> /etc/modules
|
||||
fi
|
||||
|
||||
if [ "$UPSTREAM" != "yes" ] && [ "$UPSTREAM6" != "yes" ]; then
|
||||
if [ "$KERNEL" = "5.4" ]; then
|
||||
# Load OLIA Congestion module at boot time
|
||||
if ! grep -q olia /etc/modules ; then
|
||||
echo mptcp_olia >> /etc/modules
|
||||
|
@ -706,7 +721,8 @@ if [ "$OMR_ADMIN" = "yes" ]; then
|
|||
fi
|
||||
mkdir -p /etc/openmptcprouter-vps-admin/omr-6in4
|
||||
mkdir -p /etc/openmptcprouter-vps-admin/intf
|
||||
[ ! -f "/etc/openmptcprouter-vps-admin/current-vpn" ] && echo "glorytun_tcp" > /etc/openmptcprouter-vps-admin/current-vpn
|
||||
#[ ! -f "/etc/openmptcprouter-vps-admin/current-vpn" ] && echo "glorytun_tcp" > /etc/openmptcprouter-vps-admin/current-vpn
|
||||
[ ! -f "/etc/openmptcprouter-vps-admin/current-vpn" ] && echo "openvpn" > /etc/openmptcprouter-vps-admin/current-vpn
|
||||
mkdir -p /var/opt/openmptcprouter
|
||||
if [ "$SOURCES" = "yes" ]; then
|
||||
wget -O /lib/systemd/system/omr-admin.service ${VPSURL}${VPSPATH}/omr-admin.service.in
|
||||
|
@ -764,7 +780,7 @@ if [ "$OMR_ADMIN" = "yes" ]; then
|
|||
systemctl enable omr-admin-ipv6.service
|
||||
}
|
||||
systemctl enable omr-admin.service
|
||||
if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" != "5.4" ]; then
|
||||
mptcpize enable omr-admin.service 2>&1 >/dev/null
|
||||
[ "$(ip -6 a)" != "" ] && mptcpize enable omr-admin-ipv6.service 2>&1 >/dev/null
|
||||
fi
|
||||
|
@ -772,23 +788,24 @@ fi
|
|||
|
||||
# Get shadowsocks optimization
|
||||
if [ "$LOCALFILES" = "no" ]; then
|
||||
if [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" = "6.1" ] || [ "$KERNEL" = "6.6" ]; then
|
||||
wget -O /etc/sysctl.d/90-shadowsocks.conf ${VPSURL}${VPSPATH}/shadowsocks.6.1.conf
|
||||
else
|
||||
wget -O /etc/sysctl.d/90-shadowsocks.conf ${VPSURL}${VPSPATH}/shadowsocks.conf
|
||||
fi
|
||||
else
|
||||
if [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" = "6.1" ] || [ "$KERNEL" = "6.6" ]; then
|
||||
cp ${DIR}/shadowsocks.6.1.conf /etc/sysctl.d/90-shadowsocks.conf
|
||||
else
|
||||
cp ${DIR}/shadowsocks.conf /etc/sysctl.d/90-shadowsocks.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$SHADOWSOCKS" = "yes" ]; then
|
||||
if [ "$update" != 0 ]; then
|
||||
if [ ! -f /etc/shadowsocks-libev/manager.json ]; then
|
||||
SHADOWSOCKS_PASS=$(grep -Po '"'"key"'"\s*:\s*"\K([^"]*)' /etc/shadowsocks-libev/config.json | tr -d "\n" | sed 's/-/+/g; s/_/\//g;')
|
||||
else
|
||||
elif [ -f /etc/shadowsocks-libev/manager.json ]; then
|
||||
SHADOWSOCKS_PASS=$(grep -Po '"'"65101"'":\s*"\K([^"]*)' /etc/shadowsocks-libev/manager.json | tr -d "\n" | sed 's/-/+/g; s/_/\//g;')
|
||||
fi
|
||||
fi
|
||||
|
@ -832,13 +849,13 @@ if [ $NBCPU -gt 1 ]; then
|
|||
[ -f /etc/shadowsocks-libev/config$i.json ] && systemctl is-enabled shadowsocks-libev && systemctl disable shadowsocks-libev-server@config$i.service
|
||||
done
|
||||
fi
|
||||
if ! grep -q 'DefaultLimitNOFILE=65536' /etc/systemd/system.conf ; then
|
||||
echo 'DefaultLimitNOFILE=65536' >> /etc/systemd/system.conf
|
||||
fi
|
||||
|
||||
if systemctl -q is-active shadowsocks-libev-manager@manager; then
|
||||
systemctl -q stop shadowsocks-libev-manager@manager > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
if ! grep -q 'DefaultLimitNOFILE=65536' /etc/systemd/system.conf ; then
|
||||
echo 'DefaultLimitNOFILE=65536' >> /etc/systemd/system.conf
|
||||
fi
|
||||
|
||||
if [ "$LOCALFILES" = "no" ]; then
|
||||
wget -O /lib/systemd/system/omr-update.service ${VPSURL}${VPSPATH}/omr-update.service.in
|
||||
|
@ -917,7 +934,7 @@ if [ "$V2RAY_PLUGIN" = "yes" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ "$OBFS" = "no" ] && [ "$V2RAY_PLUGIN" = "no" ]; then
|
||||
if [ "$OBFS" = "no" ] && [ "$V2RAY_PLUGIN" = "no" ] && [ -f /etc/shadowsocks-libev/config.json ]; then
|
||||
sed -i -e '/plugin/d' -e 's/,,//' /etc/shadowsocks-libev/config.json
|
||||
fi
|
||||
|
||||
|
@ -1015,7 +1032,7 @@ if [ "$V2RAY" = "yes" ]; then
|
|||
wget -O /etc/v2ray/v2ray-server.json ${VPSURL}${VPSPATH}/v2ray-server.json
|
||||
sed -i "s:V2RAY_UUID:$V2RAY_UUID:g" /etc/v2ray/v2ray-server.json
|
||||
#fi
|
||||
if ([ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]) && [ -z "$(grep mptcp /etc/v2ray/v2ray-server.json | grep true)" ]; then
|
||||
if [ "$KERNEL" != "5.4" ] && [ -z "$(grep mptcp /etc/v2ray/v2ray-server.json | grep true)" ]; then
|
||||
sed -i 's/"sockopt": {/&\n "mptcp": true,/' /etc/v2ray/v2ray-server.json
|
||||
fi
|
||||
rm -f /etc/v2ray/config.json
|
||||
|
@ -1355,7 +1372,7 @@ if [ "$OPENVPN" = "yes" ]; then
|
|||
openssl dhparam -out /etc/openvpn/server/dh2048.pem 2048
|
||||
fi
|
||||
if [ "$LOCALFILES" = "no" ]; then
|
||||
if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" != "5.4" ]; then
|
||||
wget -O /etc/openvpn/tun0.conf ${VPSURL}${VPSPATH}/openvpn-tun0.6.1.conf
|
||||
wget -O /etc/openvpn/tun1.conf ${VPSURL}${VPSPATH}/openvpn-tun1.6.1.conf
|
||||
else
|
||||
|
@ -1371,7 +1388,7 @@ if [ "$OPENVPN" = "yes" ]; then
|
|||
wget -O /etc/openvpn/bonding7.conf ${VPSURL}${VPSPATH}/openvpn-bonding7.conf
|
||||
wget -O /etc/openvpn/bonding8.conf ${VPSURL}${VPSPATH}/openvpn-bonding8.conf
|
||||
else
|
||||
if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" != "5.4" ]; then
|
||||
cp ${DIR}/openvpn-tun0.6.1.conf /etc/openvpn/tun0.conf
|
||||
cp ${DIR}/openvpn-tun1.6.1.conf /etc/openvpn/tun1.conf
|
||||
else
|
||||
|
@ -1397,7 +1414,7 @@ if [ "$OPENVPN" = "yes" ]; then
|
|||
chmod 644 /lib/systemd/system/openvpn*.service
|
||||
systemctl enable openvpn@tun0.service
|
||||
systemctl enable openvpn@tun1.service
|
||||
if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" != "5.4" ]; then
|
||||
mptcpize enable openvpn@tun0 2>&1 >/dev/null
|
||||
fi
|
||||
systemctl enable openvpn@bonding1.service
|
||||
|
@ -1415,6 +1432,7 @@ echo 'Glorytun UDP'
|
|||
if systemctl -q is-active glorytun-udp@tun0.service; then
|
||||
systemctl -q stop 'glorytun-udp@*' > /dev/null 2>&1
|
||||
fi
|
||||
if [ "$GLORYTUN_UDP" = "yes" ]; then
|
||||
if [ "$SOURCES" = "yes" ]; then
|
||||
rm -f /var/lib/dpkg/lock
|
||||
rm -f /var/lib/dpkg/lock-frontend
|
||||
|
@ -1470,6 +1488,7 @@ else
|
|||
GLORYTUN_PASS="$(cat /etc/glorytun-udp/tun0.key | tr -d '\n')"
|
||||
fi
|
||||
[ "$(ip -6 a)" != "" ] && sed -i 's/0.0.0.0/::/g' /etc/glorytun-udp/tun0
|
||||
fi
|
||||
|
||||
|
||||
# Add chrony for time sync
|
||||
|
@ -1515,7 +1534,7 @@ if [ "$DSVPN" = "yes" ]; then
|
|||
chmod 644 /lib/systemd/system/dsvpn-server@.service
|
||||
DSVPN_PASS=$(cat /etc/dsvpn/dsvpn0.key | tr -d "\n")
|
||||
fi
|
||||
if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" != "5.4" ]; then
|
||||
mptcpize enable dsvpn-server@dsvpn0 2>&1 >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
@ -1524,6 +1543,7 @@ fi
|
|||
if systemctl -q is-active glorytun-tcp@tun0.service; then
|
||||
systemctl -q stop 'glorytun-tcp@*' > /dev/null 2>&1
|
||||
fi
|
||||
if [ "$GLORYTUN_TCP" = "yes" ]; then
|
||||
if [ "$SOURCES" = "yes" ]; then
|
||||
if [ "$ID" = "debian" ]; then
|
||||
if [ "$VERSION_ID" = "9" ]; then
|
||||
|
@ -1540,13 +1560,13 @@ if [ "$SOURCES" = "yes" ]; then
|
|||
apt-get -y install build-essential pkg-config autoconf automake
|
||||
rm -rf /tmp/glorytun-0.0.35
|
||||
cd /tmp
|
||||
if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" != "5.4" ]; then
|
||||
wget -O /tmp/glorytun-0.0.35.tar.gz https://github.com/Ysurac/glorytun/archive/refs/heads/tcp.tar.gz
|
||||
else
|
||||
wget -O /tmp/glorytun-0.0.35.tar.gz https://github.com/angt/glorytun/releases/download/v0.0.35/glorytun-0.0.35.tar.gz
|
||||
fi
|
||||
tar xzf glorytun-0.0.35.tar.gz
|
||||
if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]; then
|
||||
if [ "$KERNEL" != "5.4" ]; then
|
||||
mv /tmp/glorytun-tcp /tmp/glorytun-0.0.35
|
||||
fi
|
||||
cd glorytun-0.0.35
|
||||
|
@ -1576,6 +1596,7 @@ else
|
|||
apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-overwrite" install --reinstall omr-glorytun-tcp=${GLORYTUN_TCP_BINARY_VERSION}
|
||||
fi
|
||||
[ "$(ip -6 a)" != "" ] && sed -i 's/0.0.0.0/::/g' /etc/glorytun-tcp/tun0
|
||||
fi
|
||||
|
||||
|
||||
# Load tun module at boot time
|
||||
|
@ -1849,14 +1870,26 @@ if [ "$update" = "0" ]; then
|
|||
# Save info in file
|
||||
cat > /root/openmptcprouter_config.txt <<-EOF
|
||||
SSH port: 65222 (instead of port 22)
|
||||
EOF
|
||||
if [ "$SHADOWSOCKS" = "yes" ]; then
|
||||
cat >> /root/openmptcprouter_config.txt <<-EOF
|
||||
Shadowsocks port: 65101
|
||||
Shadowsocks encryption: chacha20
|
||||
Your shadowsocks key: ${SHADOWSOCKS_PASS}
|
||||
EOF
|
||||
fi
|
||||
if [ "$SHADOWSOCKS_GO" = "yes" ]; then
|
||||
cat >> /root/openmptcprouter_config.txt <<-EOF
|
||||
Your shadowsocks 2022 key: ${PSK}:${UPSK}
|
||||
EOF
|
||||
fi
|
||||
if ([ "$GLORYTUN_TCP" = "yes" ] || [ "$GLORYTUN_UDP" = "yes" ]); then
|
||||
cat >> /root/openmptcprouter_config.txt <<-EOF
|
||||
Glorytun port: 65001
|
||||
Glorytun encryption: chacha20
|
||||
Your glorytun key: ${GLORYTUN_PASS}
|
||||
EOF
|
||||
fi
|
||||
if [ "$DSVPN" = "yes" ]; then
|
||||
cat >> /root/openmptcprouter_config.txt <<-EOF
|
||||
A Dead Simple VPN port: 65401
|
||||
|
@ -1882,7 +1915,7 @@ if [ "$update" = "0" ]; then
|
|||
Your OpenMPTCProuter Server username: openmptcprouter
|
||||
EOF
|
||||
fi
|
||||
systemctl -q restart sshd
|
||||
#systemctl -q restart sshd
|
||||
else
|
||||
echo '===================================================================================='
|
||||
echo "OpenMPTCProuter Server is now updated to version $OMR_VERSION !"
|
||||
|
@ -1910,18 +1943,27 @@ else
|
|||
systemctl -q restart v2ray
|
||||
echo 'done'
|
||||
fi
|
||||
if [ "$XRAY" = "yes" ]; then
|
||||
echo 'Restarting xray...'
|
||||
systemctl -q restart xray
|
||||
echo 'done'
|
||||
fi
|
||||
if [ "$DSVPN" = "yes" ]; then
|
||||
echo 'Restarting dsvpn...'
|
||||
systemctl -q start dsvpn-server@dsvpn0 || true
|
||||
systemctl -q restart 'dsvpn-server@*' || true
|
||||
echo 'done'
|
||||
fi
|
||||
echo 'Restarting glorytun...'
|
||||
if [ "$GLORYTUN_TCP" = "yes" ]; then
|
||||
echo 'Restarting glorytun tcp...'
|
||||
systemctl -q start glorytun-tcp@tun0 || true
|
||||
systemctl -q restart 'glorytun-tcp@*' || true
|
||||
fi
|
||||
if [ "$GLORYTUN_UDP" = "yes" ]; then
|
||||
systemctl -q start glorytun-udp@tun0 || true
|
||||
systemctl -q restart 'glorytun-udp@*' || true
|
||||
echo 'done'
|
||||
fi
|
||||
echo 'Restarting omr6in4...'
|
||||
systemctl -q start omr6in4@user0 || true
|
||||
systemctl -q restart omr6in4@* || true
|
||||
|
@ -1963,13 +2005,19 @@ else
|
|||
echo 'You can set VPS_DOMAIN to a working domain if you want a certificate.'
|
||||
fi
|
||||
echo 'Apply latest sysctl...'
|
||||
sysctl -p /etc/sysctl.d/90-shadowsocks.conf > /dev/null 2>&1
|
||||
sysctl -p /etc/sysctl.d/90-shadowsocks.conf > /dev/null 2>&1 || true
|
||||
echo 'done'
|
||||
echo 'Restarting omr...'
|
||||
systemctl -q restart omr
|
||||
echo 'done'
|
||||
if [ "$SHADOWSOCKS" = "yes" ]; then
|
||||
echo 'Restarting shadowsocks...'
|
||||
systemctl -q restart shadowsocks-libev-manager@manager
|
||||
fi
|
||||
if [ "$SHADOWSOCKS_GO" = "yes" ]; then
|
||||
echo 'Restarting shadowsocks-go...'
|
||||
systemctl -q restart shadowsocks-go
|
||||
fi
|
||||
# if [ $NBCPU -gt 1 ]; then
|
||||
# for i in $NBCPU; do
|
||||
# systemctl restart shadowsocks-libev-server@config$i
|
||||
|
|
|
@ -37,7 +37,7 @@ mv /etc/pihole/setupVars.new.conf /etc/pihole/setupVars.conf
|
|||
cat >> /etc/pihole/setupVars.conf <<-EOF
|
||||
PIHOLE_INTERFACE=gt-tun0
|
||||
IPV4_ADDRESS=10.255.0.0/16
|
||||
IPV6_ADDRESS=fe80::aff:ff01/64
|
||||
IPV6_ADDRESS=fd00::a00:/106
|
||||
RATE_LIMIT=0/0
|
||||
EOF
|
||||
|
||||
|
|
Loading…
Reference in a new issue