Add start instruction as daemon (#243)

This commit is contained in:
Alexander Alexeev 2024-12-22 02:49:09 +03:00 committed by GitHub
parent 467391bbd1
commit b11962ff9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 61 additions and 0 deletions

View File

@ -16,6 +16,13 @@ ciadpi --fake -1 --ttl 8
-p, --port <num> -p, --port <num>
Прослушиваемый порт, по умолчанию 1080 Прослушиваемый порт, по умолчанию 1080
-D, --daemon
Запуск в режиме демона
Поддерживается только в Linux и BSD системах
-w, --pidfile <filename>
Расположение PID-файла
-E, --transparent -E, --transparent
Запуск в режиме прозрачного прокси, SOCKS работать не будет Запуск в режиме прозрачного прокси, SOCKS работать не будет

26
dist/bsd/README.md vendored Normal file
View File

@ -0,0 +1,26 @@
# Installing on BSD
Tested on FreeBSD 14.1 and DrafonFly BSD 6.4
## Building
```sh
cd byedpi/
make
sudo make install
```
## System Service
You can configure the program to run as system service.
### As system service:
```sh
sudo cp byedpi /usr/local/etc/init.d
sudo sysrc byedpi_enable="YES"
```
You should see the service now marked as "active":
```sh
sudo service byedpi status
```

28
dist/bsd/byedpi vendored Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
# PROVIDE: byedpi
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Define these byedpi_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/byedpi
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
byedpi_enable=${byedpi_enable-"NO"}
byedpi_flags=${byedpi_flags-"--daemon --pidfile /var/run/ciadpi.pid -split 1 --disorder 3+s --mod-http=h,d --auto=torst --tlsrec 1+s"}
. /etc/rc.subr
name="byedpi"
rcvar=byedpi_enable
command="/usr/local/bin/ciadpi"
load_rc_config $name
start_cmd="echo \"Starting ${name}.\"; ${command} ${byedpi_flags}"
run_rc_command "$1"