summaryrefslogtreecommitdiff
path: root/sysutils/user_darwin/files/groupdel.sh
blob: 07e34ef57995f814c17788e3c2775d7d99652031 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

PATH=/bin:/usr/bin:$PATH

if [ $# -gt 1 ]; then
    echo "groupdel: Unrecognized option $1" 1>&2
    exit 1
fi

group="$1"
if [ -z "$group" ]; then
    echo "groupdel: Must specify group" 1>&2
    exit 1
fi

if ! niutil -destroy . /groups/$group 2>/dev/null &&			\
   ! dscl . -delete /groups/$group >/dev/null 2>&1 ; then
    echo "groupdel: Could not delete group" 1>&2
    exit 1
fi