1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps.git synced 2025-02-12 11:21:56 +00:00

Update API, add check for omr-service, fix v2ray service file

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-09-14 09:31:45 +00:00
parent 8cef34ed5b
commit 8ac6293b58
5 changed files with 34 additions and 10 deletions

View file

@ -61,8 +61,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="80ff9621748ec198b3a81660539a144ef443a531"
OMR_ADMIN_BINARY_VERSION="0.3+20230901"
OMR_ADMIN_VERSION="488cc5346dbfe8bcbee4413013dc22b698f1d15c"
OMR_ADMIN_BINARY_VERSION="0.3+20230911"
#OMR_ADMIN_BINARY_VERSION="0.3+20220827"
DSVPN_VERSION="3b99d2ef6c02b2ef68b5784bec8adfdd55b29b1a"
DSVPN_BINARY_VERSION="0.1.4-2"
@ -816,6 +816,7 @@ else
cp ${DIR}/omr-update /usr/bin/omr-update
chmod 755 /usr/bin/omr-update
fi
chmod 644 /lib/systemd/system/omr-update.service
# Install simple-obfs
if [ "$OBFS" = "yes" ]; then
@ -940,9 +941,15 @@ if [ "$V2RAY" = "yes" ]; then
fi
rm -f /etc/v2ray/config.json
ln -s /etc/v2ray/v2ray-server.json /etc/v2ray/config.json
if [ -f /etc/systemd/system/v2ray.service.dpkg-dist ]; then
mv -f /etc/systemd/system/v2ray.service.dpkg-dist /etc/systemd/system/v2ray.service
#if [ -f /etc/systemd/system/v2ray.service.dpkg-dist ]; then
# mv -f /etc/systemd/system/v2ray.service.dpkg-dist /etc/systemd/system/v2ray.service
#fi
if [ "$LOCALFILES" = "no" ]; then
wget -O /lib/systemd/system/v2ray.service ${VPSURL}${VPSPATH}/v2ray.service
else
cp ${DIR}/v2ray.service /lib/systemd/system/v2ray.service
fi
chmod 644 /lib/systemd/system/v2ray.service
systemctl daemon-reload
systemctl enable v2ray.service
#if [ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]; then
@ -1671,13 +1678,13 @@ if [ "$update" = "0" ]; then
fi
if [ "$MLVPN" = "yes" ]; then
cat >> /root/openmptcprouter_config.txt <<-EOF
MLVPN first port: 65201'
MLVPN first port: 65201
Your MLVPN password: $MLVPN_PASS
EOF
fi
if [ "$UBOND" = "yes" ]; then
cat >> /root/openmptcprouter_config.txt <<-EOF
UBOND first port: 65251'
UBOND first port: 65251
Your UBOND password: $UBOND_PASS
EOF
fi

View file

@ -114,7 +114,7 @@ _gre_tunnels() {
. "$(readlink -f "$intf")"
iface="$(basename $intf)"
if [ "$(ip tunnel show $iface 2>/dev/null | awk '{print $4}')" != "$OMR_ADDR" ]; then
ip tunnel del $iface 2>&1 >/dev/null
[ -n "$(ip tunnel show $iface 2>/dev/null)" ] && ip tunnel del $iface 2>&1 >/dev/null
ip tunnel add $iface mode gre local $INTFADDR remote $OMR_ADDR 2>&1 >/dev/null
ip link set $iface up 2>&1 >/dev/null
ip addr add $LOCALIP dev $iface 2>&1 >/dev/null

View file

@ -1,6 +1,6 @@
[Unit]
Description=OMR
After=network.target network-online.target glorytun-tcp@.service glorytun-udp@.service
After=network.target network-online.target glorytun-tcp@.service glorytun-udp@.service shorewall.service
[Service]
Type=simple

View file

@ -92,8 +92,7 @@
"pass": "V2RAY_UUID",
"user": "openmptcprouter"
}
],
"udp": true
]
},
"streamSettings": {
"sockopt": {

18
v2ray.service Normal file
View file

@ -0,0 +1,18 @@
[Unit]
Description=V2Ray Service
Documentation=https://www.v2fly.org/
After=network.target nss-lookup.target
Wants=network-online.target
[Service]
User=root
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW
NoNewPrivileges=true
ExecStart=/usr/bin/v2ray run -config /etc/v2ray/config.json
Restart=always
RestartPreventExitStatus=23
StartLimitInterval=0
[Install]
WantedBy=multi-user.target