openwrt安装ServerStatus_Rust客户端
1、下载stat_client,上传到/opt/ServerStatus目录
mkdir -p /opt/ServerStatus
赋予权限
chmod +x stat_client
2、新建/etc/init.d/stat_client文件
nano /etc/init.d/stat_client
粘贴如下内容(注意替换网址及密码等信息)
#!/bin/sh /etc/rc.common
# OpenWrt init script for stat_client
START=99
USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command /opt/ServerStatus/stat_client -a "https://status.67890.de/report" -u h1 -p p1 -i pppoe-wan
procd_set_param respawn
procd_close_instance
}
保存赋予权限
chmod +x /etc/init.d/stat_client
3、将脚本添加到开机启动项
/etc/init.d/stat_client enable
4、手动启动脚本
/etc/init.d/stat_client start