#!/bin/sh /etc/rc.common # OpenWRT procd init script for mhrv-rs. # Install as /etc/init.d/mhrv-rs, then: # /etc/init.d/mhrv-rs enable # /etc/init.d/mhrv-rs start # # Expects: # /usr/bin/mhrv-rs (the static musl binary from the release) # /etc/mhrv-rs/config.json (your config) START=99 USE_PROCD=1 BIN=/usr/bin/mhrv-rs CONFIG=/etc/mhrv-rs/config.json start_service() { [ -x "$BIN" ] || return 1 [ -f "$CONFIG" ] || return 1 procd_open_instance procd_set_param command "$BIN" --config "$CONFIG" --no-cert-check procd_set_param respawn 3600 5 5 procd_set_param stdout 1 procd_set_param stderr 1 procd_set_param file "$CONFIG" procd_close_instance } reload_service() { stop start }