Skip to content
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 启动daed的init.d脚本 #21

Open
youwei5683 opened this issue Jun 13, 2023 · 4 comments
Open

Openwrt 启动daed的init.d脚本 #21

youwei5683 opened this issue Jun 13, 2023 · 4 comments

Comments

@youwei5683
Copy link

youwei5683 commented Jun 13, 2023

一、使用说明: touch /etc/init.d/daed 然后把以下内容替换到 /etc/init.d/daed

#!/bin/sh /etc/rc.common

START=99
STOP=99
#如果不需要记录日志,修改 LOG_FILE="/dev/null"
#LOG_FILE="/dev/null"

LOG_FILE="/var/log/daed.log"

start() {
    # 检查 dae 进程是否已经在运行
    if [ $(pidof /usr/bin/daed) ]; then
        echo "daed process is already running!"
        return 1
    fi
    # 启动 daed 进程,daed 监听Ip和端口可以自行修改,并将日志输出到 LOG_FILE 文件中
    /usr/bin/daed run -c /etc/dae/  >> $LOG_FILE 2>&1 &
    echo "Started daed process.default listening address http://ip:2023 "

    # 记录进程 PID
    echo $! > /var/run/daed.pid
   
}

stop() {
    # 停止 daed 进程
	if [ -f /var/run/daed.pid ]; then
		pid=$(cat /var/run/daed.pid)
		
		kill -15 $pid
		echo "daed stopped"
	else
		echo "daed is not running"
	fi

    # 删除进程 PID 文件
    rm -f /var/run/daed.pid
}

restart() {
    stop
    sleep 1
    start
}
@dae-prow
Copy link
Contributor

dae-prow bot commented Jun 13, 2023

Thanks for opening this issue!

@kunish kunish pinned this issue Jun 13, 2023
@kunish
Copy link
Member

kunish commented Jun 13, 2023

感谢老哥,可以帮助到想在openwrt下吃鹅的朋友们

@QiuSimons
Copy link

可以考虑试一下咱写的废物luci
https://github.com/QiuSimons/luci-app-daed
兼容的是这个pkg
https://github.com/immortalwrt/packages/tree/master/net/daed

@X-MMXXIII
Copy link

可以考虑试一下咱写的废物luci
https://github.com/QiuSimons/luci-app-daed
兼容的是这个pkg
https://github.com/immortalwrt/packages/tree/master/net/daed

增加个日志就好了。。。
另外geoDATA是不是可以共用v2ray/xray的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants