3 # File : privoxy-create-nicl.sh
5 # Purpose : Create the privoxy group and user for OS X 10.3,4
7 # Copyright : Written by and Copyright (C) 2001-2012 the
8 # Privoxy team. http://www.privoxy.org/
10 # This program is free software; you can redistribute it
11 # and/or modify it under the terms of the GNU General
12 # Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at
14 # your option) any later version.
16 # This program is distributed in the hope that it will
17 # be useful, but WITHOUT ANY WARRANTY; without even the
18 # implied warranty of MERCHANTABILITY or FITNESS FOR A
19 # PARTICULAR PURPOSE. See the GNU General Public
20 # License for more details.
22 # The GNU General Public License should be included with
23 # this file. If not, you can view it at
24 # http://www.gnu.org/copyleft/gpl.html
25 # or write to the Free Software Foundation, Inc.,
26 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
29 # Modification : If you modify this file please consider whether your
30 # changes ought to be passed back to the macsetup module.
34 # check for existing privoxy group and user
36 gname="`/usr/bin/nireport . /groups name | /usr/bin/grep -E '^privoxy?'`"
37 uname="`/usr/bin/nireport . /users name | /usr/bin/grep -E '^privoxy?'`"
42 if [ -z ${gname} ]; then
43 echo "Notice: creating a privoxy group."
44 gid1="`/usr/bin/nireport . /groups gid | /usr/bin/sort -n | /usr/bin/tail -1`"
45 gid="`/bin/expr ${gid1} + 1`"
47 /usr/bin/nicl . -create /groups/privoxy
48 /usr/bin/nicl . -create /groups/privoxy passwd "*"
49 /usr/bin/nicl . -create /groups/privoxy gid ${gid}
51 echo "Notice: a privoxy group already exists."
57 if [ -z ${uname} ]; then
58 echo "Notice: creating a privoxy user."
59 uid1="`/usr/bin/nireport . /users uid | /usr/bin/sort -n | /usr/bin/tail -1`"
60 uid="`/bin/expr ${uid1} + 1`"
62 /usr/bin/nicl . -create /users/privoxy
63 /usr/bin/nicl . -create /users/privoxy passwd "*"
64 /usr/bin/nicl . -create /users/privoxy uid ${uid}
65 /usr/bin/nicl . -create /users/privoxy gid ${gid}
66 /usr/bin/nicl . -create /users/privoxy change 0
67 /usr/bin/nicl . -create /users/privoxy expire 0
68 /usr/bin/nicl . -create /users/privoxy realname "Privoxy Web Proxy"
69 /usr/bin/nicl . -create /users/privoxy home /var/empty
70 /usr/bin/nicl . -create /users/privoxy shell /usr/bin/false
71 /usr/bin/nicl . -create /users/privoxy _shadow_passwd ""
73 echo "Notice: a privoxy user already exists."