install bath

This commit is contained in:
2025-05-01 22:40:30 +08:00
parent 6e66dd9fa6
commit aa1a229261
3 changed files with 72 additions and 1 deletions

49
install.sh Normal file
View File

@@ -0,0 +1,49 @@
#!/bin/bash
# 克隆仓库
git clone https://git.nia.ink/brnet/softether.git
# 检查克隆是否成功
if [ $? -ne 0 ]; then
echo "克隆仓库失败,请检查网络或仓库地址。"
exit 1
fi
# 移动 softether.service 到 /etc/systemd/system 目录
sudo mv ./softether/softether.service /etc/systemd/system/
# 检查移动是否成功
if [ $? -ne 0 ]; then
echo "移动 softether.service 文件失败。"
exit 1
fi
# 移动 softether 目录到根目录
sudo mv ./softether/ /
# 检查移动是否成功
if [ $? -ne 0 ]; then
echo "移动 softether 目录到根目录失败。"
exit 1
fi
# 启动 softether 服务
sudo systemctl start softether.service
# 检查服务是否启动成功
if [ $? -ne 0 ]; then
echo "启动 softether 服务失败。"
exit 1
fi
# 设置 softether 服务开机自启
sudo systemctl enable softether.service
# 检查设置是否成功
if [ $? -ne 0 ]; then
echo "设置 softether 服务开机自启失败。"
exit 1
fi
echo "SoftEther 服务已成功安装、启动并设置为开机自启。"

View File

@@ -4,4 +4,15 @@
只需要git clone本仓库并且给予 **vpn*** 文件 **777**权限你就可以快读的获取并执行softetherVPN了。
本仓库制品在ubuntu22.0环境下编译理论上对ubuntu都适用。
本仓库制品在ubuntu22.0环境下编译理论上对ubuntu都适用。
一键安装脚本:
```
wget https://git.nia.ink/brnet/softether/raw/branch/main/install.sh
chmod 777 ./install.sh
./install.sh
```

11
softether.service Normal file
View File

@@ -0,0 +1,11 @@
[Unit]
Description=SoftEther VPN Server
After=network.target
[Service]
Type=forking
ExecStart=/softether/vpnserver start
ExecStop=/softether/vpnserver stop
[Install]
WantedBy=multi-user.target