#!/bin/sh /etc/rc.common
#
# Copyright (C) 2016-2019 eGloo, Incorporated
#
# This is free software, licensed under the GNU General Public License v2.

START=50
STOP=50

USE_PROCD=1
PROG=/usr/sbin/netifyd
NETIFYD_AUTODETECT=yes

start_service() {
    mkdir -p /etc/netify.d
    mkdir -p /var/run/netifyd

    source /usr/share/netifyd/functions.sh
    NETIFYD_OPTS=$(auto_detect_options)

    load_modules

    procd_open_instance
    procd_set_param command $PROG -R $NETIFYD_OPTS
    procd_set_param file /etc/netifyd.conf
    procd_set_param respawn
    procd_close_instance
}
