#!/bin/sh -e

##########################################################################
#   Script description:
#       Verify that calling user is a member of operator.
#       
#   History:
#   Date        Name        Modification
#   2019-07-16  Jason Bacon Begin
##########################################################################

usage()
{
    printf "Usage: $0 group calling-script-name\n"
    exit 1
}


##########################################################################
#   Main
##########################################################################

if [ $# != 2 ]; then
    usage
fi
group="$1"
script="$2"

if ! groups | fgrep -q "$group"; then
    printf "$script can only be run by members of $group.\n"
    exit 1
fi
