b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | #!/bin/sh /etc/rc.common |
2 | # Copyright (C) 2016 OpenWrt.org | ||||
3 | |||||
4 | NAME=crelay | ||||
5 | START=93 | ||||
6 | |||||
7 | PROG=/usr/bin/${NAME} | ||||
8 | |||||
9 | USE_PROCD=1 | ||||
10 | |||||
11 | # Custom relay labels (for Web GUI) are defined in /etc/crelay.conf | ||||
12 | |||||
13 | start_service() { | ||||
14 | procd_open_instance | ||||
15 | |||||
16 | # restart if it croaks | ||||
17 | procd_set_param respawn | ||||
18 | |||||
19 | procd_set_param command "$PROG" | ||||
20 | # daemon mode in foreground - starts HTTP server | ||||
21 | procd_append_param command -d | ||||
22 | |||||
23 | procd_close_instance | ||||
24 | } |