-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
可否增加openwrt的安裝? #25
Comments
@xiagw 你可以剽窃 openwrt-21.02 中的 xray-core 软件包 |
手动安装,以下 service 脚本仅供参考 #!/bin/sh /etc/rc.common
# /etc/init.d/xray enable
START=91
STOP=89
USE_PROCD=1
LimitNOFILE=1048576
LimitNPROC=512
PID_DIR=/var/run
NAME=xray
PID_FILE=$PID_DIR/$NAME.pid
check_running() {
if [ -r $PID_FILE ]; then
read -r PID <$PID_FILE
if [ -d "/proc/$PID" ]; then
return 0
else
rm -f $PID_FILE
return 1
fi
else
return 2
fi
}
start_service() {
echo "Starting $NAME..."
mkdir /var/log/$NAME >/dev/null 2>&1
ulimit -n 99999
procd_open_instance
procd_set_param respawn
procd_set_param env XRAY_LOCATION_ASSET=/usr/local/etc/$NAME
procd_set_param command /usr/local/bin/$NAME -confdir /usr/local/etc/$NAME
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param pidfile /var/run/$NAME.pid
procd_close_instance
check_running
}
stop_service() {
if check_running; then
kill -9 $PID
rm -f $PID_FILE
echo "Stopping $NAME success"
else
echo "$NAME is stopped"
RET_VAL=1
fi
}
reload_service() {
echo "Restarting $NAME..."
stop_service
sleep 0.5
start_service
}
|
感谢,这个是 init.d 的脚本,这个可以作为 install-release.sh 的附件。 |
比较困难,openwrt没有使用systemctl。
这样是行不通的,脚本定位是一个广泛适配的脚本,不能为了某个特定系统而采取特殊的安装方式 |
The text was updated successfully, but these errors were encountered: