4 # Copyright (c)2008,2009 Barton IT-Consulting, Alexander Barton
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE.
13 # See the GNU General Public License for more details.
19 echo "$NAME (userlist.macosx.sh) release $RELEASE"
20 echo "Copyright (c)2008,2009 Barton IT-Consulting, Alex Barton (alex@barton-it.de)"
22 echo "This is free software; see the source for copying conditions. There is NO"
23 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
25 echo "Usage: $0 [--all|-a] [--local|-l]"
45 sw_vers -productName | grep -i "Server" >/dev/null 2>&1
46 if [ $? -eq 0 -a -z "$LOCAL" ]; then
53 USER_BASE="/LDAPv3/127.0.0.1/Users"
61 [ -n "$ALL" ] && UID_MIN=0
63 dscl "$HOST" -list "$USER_BASE" | while read x; do
65 id=`dscl "$HOST" -read "$USER_BASE/$x" UniqueID | cut -d: -f2`
66 if [ "$id" -gt $UID_MIN ]; then