mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-01-19 06:19:31 +08:00
Created 进程保活 (markdown)
parent
abd6be360c
commit
5c2eb193a3
28
进程保活.md
Normal file
28
进程保活.md
Normal file
@ -0,0 +1,28 @@
|
||||
介绍一种简单方法,保证udp2raw在被杀掉/意外退出后,可以自动重新启动
|
||||
|
||||
#### 创建run.sh
|
||||
把以下内容保存为 run.sh
|
||||
```
|
||||
#! /bin/sh
|
||||
while true
|
||||
do
|
||||
$@
|
||||
sleep 1
|
||||
done
|
||||
```
|
||||
|
||||
运行`chmod 755 run.sh`
|
||||
|
||||
#### 通过run.sh执行udp2raw
|
||||
|
||||
以后通过run.sh来执行udp2raw,比如原本你的udp2raw命令是:
|
||||
```
|
||||
./udp2raw_amd64 -s -l0.0.0.0:4096 -r 127.0.0.1:7777 -a -k "passwd" --raw-mode faketcp
|
||||
```
|
||||
|
||||
现在改成:
|
||||
```
|
||||
./run.sh ./udp2raw_amd64 -s -l0.0.0.0:4096 -r 127.0.0.1:7777 -a -k "passwd" --raw-mode faketcp
|
||||
```
|
||||
|
||||
即可达到目的
|
Loading…
x
Reference in New Issue
Block a user