lightwan-cli
Installation
SKILL.md
LightWAN CLI 手动控制
连接/断开本机 LightWAN(贝斯达 SD-WAN)客户端。核心是两条腿,缺一不可:
- orch HTTP 连接事件——先告诉服务端"本机要连接",隧道才会被放行。只起数据面不调这个接口,服务端立刻下发
enable=0(日志:Orch forcibly disconnects)。 - UDS 控制命令——
lightwan -D向守护进程(root)发命令,启停数据面进程。
所有凭据从配置文件读取,不硬编码:序列号/token 在 ~/.config/LightWAN/setting.conf(SERIAL/TOKEN),客户 ID 在 /opt/apps/com.lightwan/files/cpeagent.conf(customerid)。
连接
1. 读取配置
SERIAL=$(grep '^SERIAL=' ~/.config/LightWAN/setting.conf | cut -d= -f2)
TOKEN=$(grep '^TOKEN=' ~/.config/LightWAN/setting.conf | cut -d= -f2)
CUSTOMERID=$(grep '^customerid=' /opt/apps/com.lightwan/files/cpeagent.conf | cut -d= -f2)