#!/bin/sh # File : privoxy-create-nicl.sh # # Purpose : Create the privoxy group and user for OS X 10.3,4 # # Copyright : Written by and Copyright (C) 2001-2012 the # Privoxy team. http://www.privoxy.org/ # # This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at # your option) any later version. # # This program is distributed in the hope that it will # be useful, but WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU General Public # License for more details. # # The GNU General Public License should be included with # this file. If not, you can view it at # http://www.gnu.org/copyleft/gpl.html # or write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA # # Modification : If you modify this file please consider whether your # changes ought to be passed back to the OSXPackageBuilder # module. # # # check for existing privoxy group and user # gname="`/usr/bin/nireport . /groups name | /usr/bin/grep -E '^privoxy?'`" uname="`/usr/bin/nireport . /users name | /usr/bin/grep -E '^privoxy?'`" # # create group # if [ -z ${gname} ]; then echo "Notice: creating a privoxy group." gid1="`/usr/bin/nireport . /groups gid | /usr/bin/sort -n | /usr/bin/tail -1`" gid="`/bin/expr ${gid1} + 1`" /usr/bin/nicl . -create /groups/privoxy /usr/bin/nicl . -create /groups/privoxy passwd "*" /usr/bin/nicl . -create /groups/privoxy gid ${gid} else echo "Notice: a privoxy group already exists." fi # # create user # if [ -z ${uname} ]; then echo "Notice: creating a privoxy user." uid1="`/usr/bin/nireport . /users uid | /usr/bin/sort -n | /usr/bin/tail -1`" uid="`/bin/expr ${uid1} + 1`" /usr/bin/nicl . -create /users/privoxy /usr/bin/nicl . -create /users/privoxy passwd "*" /usr/bin/nicl . -create /users/privoxy uid ${uid} /usr/bin/nicl . -create /users/privoxy gid ${gid} /usr/bin/nicl . -create /users/privoxy change 0 /usr/bin/nicl . -create /users/privoxy expire 0 /usr/bin/nicl . -create /users/privoxy realname "Privoxy Web Proxy" /usr/bin/nicl . -create /users/privoxy home /var/empty /usr/bin/nicl . -create /users/privoxy shell /usr/bin/false /usr/bin/nicl . -create /users/privoxy _shadow_passwd "" else echo "Notice: a privoxy user already exists." fi exit 0