Linux 下将校园网客户端锐捷制作成服务并开机启动


1.下载锐捷,解压后给rjsupplicant.sh 添加可执行权限

2.创建一个 systemd 启动脚本并将其放在 /etc/systemd/system/ 目录中,内容如下

# ruijie.service

[Unit]
Description=Run ruijie
After=network.target

[Service]
ExecStart=/home/rjsupplicant/rjsupplicant.sh  -u stuxxxx -p passwordxxxx -d 0 
ExecStop=/home/rjsupplicant/rjsupplicant.sh -q
ExecReload=/home/rjsupplicant/rjsupplicant.sh -u stuxxxx -p passwordxxxx -d 0
Restart=on-failure
KillMode=control-group


[Install]
WantedBy=multi-user.target

3.运行以下命令启动服务

systemctl daemon-reload
systemctl enable ruijie.service
systemctl start  ruijie #启动锐捷
systemctl status ruijie #查看锐捷状态

img

4.重启检查是否启动

reboot
ps aux|grep rjsupplicant
ping www.baidu.com

文章作者: Czq
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 !
评论
  目录