#!/bin/bash
#
# Copyright (c) 2019, AT&T Intellectual Property.
# All rights reserved.
#
# SPDX-License-Identifier: GPL-2.0-only
#

if [ ${COMMIT_ACTION} = 'DELETE' ] ;
then
    # detach from global attach point before delete
    npf-session-limit.pl --cmd="assign" --type="global"

    npf-session-limit.pl --cmd="delete" --type="global"
else
    npf-session-limit.pl --cmd="update" --type="global"

    # attach/detach to/from global attach point
    npf-session-limit.pl --cmd="assign" --type="global"
fi
