#!/bin/sh

. /lib/functions/keepalived/hotplug.sh

set_service_name netifyd

set_restart_if_master
set_stop_if_backup

services="dpi dpi-data-update dpi-license-update dpi-update ns-flows ns-stats"

if [ "$ACTION" == "NOTIFY_MASTER" ]; then
    for service in $services; do
        /etc/init.d/$service restart
    done
elif [ "$ACTION" == "NOTIFY_BACKUP" ]; then
    for service in $services; do
        /etc/init.d/$service stop
    done
fi

keepalived_hotplug
