9d68495d5a
functionality of the POSIX batch queueing framework. WWW: http://gridengine.sunsource.net/ PR: 54563 Submitted by: brooks Many suggestion by: Glenn Johnson <gjohnson at srrc dot ars dot usda dot gov>
35 lines
719 B
Bash
35 lines
719 B
Bash
#!/bin/sh
|
|
|
|
u=sgeadmin
|
|
g=sgeadmin
|
|
ugid=96
|
|
homedir=/nonexistent
|
|
shell=/sbin/nologin
|
|
comment="Sun Grid Engine Admin"
|
|
|
|
case $2 in
|
|
PRE-INSTALL)
|
|
if pw group show "${g}" >/dev/null 2>&1; then
|
|
echo "Using existing group \"${g}\"."
|
|
else
|
|
echo "Creating group \"${g}\", (gid: ${ugid})."
|
|
pw groupadd ${g} -g ${ugid}
|
|
if [ $? != 0 ]; then
|
|
echo "Failed to add group \"${g}\"."
|
|
exit 1
|
|
fi
|
|
fi
|
|
if pw user show "${u}" >/dev/null 2>&1; then
|
|
echo "Using existing user \"${u}\"."
|
|
else
|
|
echo "Creating user \"${u}\", (uid: ${ugid})."
|
|
pw useradd ${u} -u ${ugid} -g ${ugid} -h - \
|
|
-d ${homedir} -s ${shell} -c "${comment}"
|
|
if [ $? != 0 ]; then
|
|
echo "Failed to add user \"${u}\"."
|
|
exit 1
|
|
fi
|
|
fi
|
|
;;
|
|
esac
|