可否增加openwrt的安裝? #25

Open
opened 2021-05-07 08:38:28 -04:00 by xiagw · 4 comments
xiagw commented 2021-05-07 08:38:28 -04:00 (Migrated from github.com)
cat /etc/os-release
NAME="OpenWrt"
VERSION="19.07.7"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt 19.07.7"
VERSION_ID="19.07.7"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r11306-c4a6851c72"
OPENWRT_BOARD="x86/64"
OPENWRT_ARCH="x86_64"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt 19.07.7 r11306-c4a6851c72"
``` cat /etc/os-release NAME="OpenWrt" VERSION="19.07.7" ID="openwrt" ID_LIKE="lede openwrt" PRETTY_NAME="OpenWrt 19.07.7" VERSION_ID="19.07.7" HOME_URL="https://openwrt.org/" BUG_URL="https://bugs.openwrt.org/" SUPPORT_URL="https://forum.openwrt.org/" BUILD_ID="r11306-c4a6851c72" OPENWRT_BOARD="x86/64" OPENWRT_ARCH="x86_64" OPENWRT_TAINTS="" OPENWRT_DEVICE_MANUFACTURER="OpenWrt" OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/" OPENWRT_DEVICE_PRODUCT="Generic" OPENWRT_DEVICE_REVISION="v0" OPENWRT_RELEASE="OpenWrt 19.07.7 r11306-c4a6851c72" ```
1715173329 commented 2021-05-07 08:46:36 -04:00 (Migrated from github.com)

@xiagw 你可以剽窃 openwrt-21.02 中的 xray-core 软件包

@xiagw 你可以剽窃 openwrt-21.02 中的 xray-core 软件包
Rirmach commented 2021-05-07 08:49:46 -04:00 (Migrated from github.com)

手动安装,以下 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
}

手动安装,以下 service 脚本仅供参考 ```shell #!/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 } ```
xiagw commented 2021-05-07 22:04:37 -04:00 (Migrated from github.com)

感谢,这个是 init.d 的脚本,这个可以作为 install-release.sh 的附件。
我的意思是说能否在 install-release.sh 里面增加一个 判断 openwrt ,
就在 systemd 的那个判断 加上 判断 openwrt,
然后再附上上面的 init脚本,就能在 openwrt 里自动安装好,

感谢,这个是 init.d 的脚本,这个可以作为 install-release.sh 的附件。 我的意思是说能否在 install-release.sh 里面增加一个 判断 openwrt , 就在 systemd 的那个判断 加上 判断 openwrt, 然后再附上上面的 init脚本,就能在 openwrt 里自动安装好,
ghost commented 2021-05-08 12:29:21 -04:00 (Migrated from github.com)

比较困难,openwrt没有使用systemctl。

我的意思是说能否在 install-release.sh 里面增加一个 判断 openwrt ,
就在 systemd 的那个判断 加上 判断 openwrt,
然后再附上上面的 init脚本,就能在 openwrt 里自动安装好,

这样是行不通的,脚本定位是一个广泛适配的脚本,不能为了某个特定系统而采取特殊的安装方式

比较困难,openwrt没有使用systemctl。 > 我的意思是说能否在 install-release.sh 里面增加一个 判断 openwrt , > 就在 systemd 的那个判断 加上 判断 openwrt, > 然后再附上上面的 init脚本,就能在 openwrt 里自动安装好, 这样是行不通的,脚本定位是一个广泛适配的脚本,不能为了某个特定系统而采取特殊的安装方式
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
XTLS/Xray-install#25
No description provided.