iopsys-feed/stunc/files/etc/init.d/stund

36 lines
656 B
Bash
Executable file

#!/bin/sh /etc/rc.common
# STUN client software
# Copyright (C) 2020 iopsys Software Solutions AB
# Author: Omar Kallel <omar.kallel@pivasoftware.com>
START=90
USE_PROCD=1
PROG="/usr/sbin/stund"
start_service() {
local enable=`uci -q get stun.stun.enable`
if [ "$enable" == "1" ]; then
local server=`uci -q get stun.stun.server_address`
[ "$server" = "" ] && exit 0
procd_open_instance
procd_set_param command "$PROG"
procd_set_param respawn "3" "7" "0"
procd_close_instance
fi
}
boot() {
start
}
reload_service() {
logger -p crit -t "stun" "reloading service()"
stop
start
}
service_triggers()
{
procd_add_reload_trigger stun
}