telephony/net/rtpproxy/files/rtpproxy.hotplug
Sebastian Kemper 0b092cbe2b rtpproxy: add hotplug script
Install hotplug script along with rtpproxy. It will only be used if
enabled by the user (via uci config file).

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2018-11-05 20:16:56 +01:00

24 lines
430 B
Bash

#!/bin/sh
[ "$ACTION" = ifup ] || exit 0
NAME=rtpproxy
COMMAND=/etc/init.d/$NAME
LOGGER="/usr/bin/logger -t hotplug"
$COMMAND enabled || exit 0
. /lib/functions.sh
config_load $NAME
config_get_bool enabled global enabled 0
[ $enabled -eq 0 ] && exit 0
config_get hotplug_iface hotplug interface
[ "$INTERFACE" = "$hotplug_iface" ] && {
$LOGGER "Restarting $NAME due to \"$ACTION\" of \"$INTERFACE\""
$COMMAND restart
}