pkgsrc/sysutils/user_darwin/files/groupdel.sh
rh d55390bb88 Update the user_darwin scripts to 20071026. This adds compatibility with
Darwin 9.x / Mac OS X 10.5 (Leopard), which no longer uses netinfo.
2007-10-29 08:12:55 +00:00

20 lines
397 B
Bash
Executable file

#!/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