mirror of
https://github.com/snltty/linker.git
synced 2025-11-01 21:13:04 +08:00
166
This commit is contained in:
@@ -2,6 +2,10 @@ Package: linker
|
||||
Version: {version}
|
||||
Architecture: all
|
||||
Maintainer: snltty <1069410172@qq.com>
|
||||
Section: utils
|
||||
Description: linker
|
||||
Depends: libc, libstdcpp, zlib, bash, iptables, libopenssl, libopenssl-legacy
|
||||
Section: net
|
||||
Source: https://github.com/snltty/linker
|
||||
License: GPL-2.0
|
||||
Priority: optional
|
||||
Depends: libc
|
||||
Recommends: libstdcpp, zlib, bash, iptables, kmod-tun, ip-full, libopenssl, libopenssl-legacy
|
||||
Description: A NAT transfer, Virtual Private Network, P2P Tunnel
|
||||
@@ -2,76 +2,9 @@
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# 2.3、安装方法(openwrt)
|
||||
|
||||
## 1、使用ipk安装
|
||||
:::tip[说明]
|
||||
1. 在 `System(系统)`、`Software(软件包)`、`Update Package(更新列表)`先更新一下
|
||||
2. 下载对应架构的ipk文件,在`System(系统)`、`Software(软件包)`、`Upload Package(上传软件包)`上传ipk文件安装
|
||||
3. 如果ui无法安装,或者安装失败,可以尝试使用命令安装,`opkg install --force-depends linker-xxx.ipk` 忽略依赖安装错误
|
||||
|
||||
```
|
||||
wget https://musl.libc.org/releases/musl-1.2.2.tar.gz
|
||||
tar -xvzf musl-1.2.2.tar.gz
|
||||
cd musl-1.2.2
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
```
|
||||
:::
|
||||
|
||||
## 2、手动 init.d
|
||||
|
||||
:::tip[说明]
|
||||
1. 进入系统安装依赖 `opkg update && opkg install libstdcpp zlib bash libopenssl libopenssl-legacy iptables`
|
||||
2. 下载linux版本程序,放到 `/usr/bin/linker` 文件夹
|
||||
3. 写配置文件,在 `/etc/init.d` 目录下创建一个服务文件linker,内容如下
|
||||
```
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99 #服务启动优先级(数字越大,启动越晚)
|
||||
STOP=10 #服务停止优先级(数字越小,停止越早)
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/bin/linkerlinker #linker程序
|
||||
WORKDIR=/usr/bin/linker # 指定工作目录
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn # 自动重启
|
||||
procd_set_param stdout 0 # 重定向标准输出到日志
|
||||
procd_set_param stderr 1 # 重定向标准错误到日志
|
||||
procd_set_param cwd "$WORKDIR" # 设置工作目录
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
killall linker
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
status() {
|
||||
if pgrep -f "$PROG" > /dev/null; then
|
||||
echo "Service is running."
|
||||
return 0
|
||||
else
|
||||
echo "Service is not running."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
```
|
||||
4. 运行命令
|
||||
```
|
||||
设置脚本权限
|
||||
chmod +x /etc/init.d/linker
|
||||
启用服务
|
||||
/etc/init.d/linker enable
|
||||
启动服务
|
||||
/etc/init.d/linker start
|
||||
```
|
||||
:::
|
||||
:::
|
||||
@@ -1,5 +1,5 @@
|
||||
v1.6.6
|
||||
2025-02-11 00:30:21
|
||||
2025-02-11 02:27:57
|
||||
1. 适配OpenWrt的NAT
|
||||
2. 打包ipk
|
||||
3. 修复首次启动网卡未启动bug
|
||||
|
||||
Reference in New Issue
Block a user