#!/bin/bash # Copyright (c) 2000,2004 Matthias S. Benkmann
# You may do everything with this code except misrepresent its origin. # PROVIDED `AS IS' WITH ABSOLUTELY NO WARRANTY OF ANY KIND! if [ $# -ne 3 ]; then echo 1>&2 echo 1>&2 'USAGE: install_package ' echo 1>&2 echo 1>&2 'Creates a new package user called with primary group ' echo 1>&2 'and description .' echo 1>&2 'If the user account has been created successfully, `su '"'"' will be' echo 1>&2 'executed so that you can start working with the new account right away.' echo 1>&2 echo 1>&2 ' needs to be a valid string for the /etc/passwd description' echo 1>&2 ' field. This means, among other things, that it must not contain ":".' echo 1>&2 ' Don'"'"'t forget to properly quote if it contains spaces or' echo 1>&2 ' other characters interpreted by the shell!' echo 1>&2 echo 1>&2 'This script leaves the actual creation of the new account to the' echo 1>&2 'add_package_user script. Check out its documentation for details.' echo 1>&2 exit 1 fi if [ $UID -ne 0 ]; then echo Please run this script as root. exit 1 fi add_package_user "${1}" $2 10000 20000 $3 10000 20000 || exit 1 rm -f /var/mail/$2 su $2