blob: b7c5123d9514930b464db64b89289ad29c10a014 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#!/bin/sh /etc/rc.common
2# Copyright (C) 2016 OpenWrt.org
3
4NAME=crelay
5START=93
6
7PROG=/usr/bin/${NAME}
8
9USE_PROCD=1
10
11# Custom relay labels (for Web GUI) are defined in /etc/crelay.conf
12
13start_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}