mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
32 lines
639 B
Bash
Executable file
32 lines
639 B
Bash
Executable file
#!/bin/sh /etc/rc.common
|
|
# TWAMP Reflector software
|
|
# Copyright (C) 2020-2022 IOPSYS Software Solutions AB
|
|
# Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
|
|
|
START=99
|
|
STOP=10
|
|
|
|
USE_PROCD=1
|
|
PROG="/usr/sbin/twampd"
|
|
|
|
start_service() {
|
|
local enable=$(uci -q get twamp.twamp.enable)
|
|
if [ "$enable" = "1" ]; then
|
|
procd_open_instance
|
|
procd_set_param command "$PROG"
|
|
procd_set_param respawn "3" "7" "0"
|
|
procd_close_instance
|
|
fi
|
|
}
|
|
|
|
reload_service() {
|
|
stop
|
|
start
|
|
[ -f /etc/firewall.twamp ] && {
|
|
sh /etc/firewall.twamp
|
|
}
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger twamp
|
|
}
|