-
Notifications
You must be signed in to change notification settings - Fork 154
/
create_me.ksh
56 lines (42 loc) · 1001 Bytes
/
create_me.ksh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/ksh
# Script Name : create_me.ksh
# Author : Craig Richards
# Created : 11-February-2007
# Last Modified :
# Version :
# Modifications :
# Description : I use this to create me on new Solaris builds
#################################
# Start of procedures/functions #
#################################
funct_check_user()
{
if [ `/usr/ucb/whoami` != root ]
then echo 'You Must be ROOT to execute this script !!!'
exit 99
fi
}
funct_create_user()
{
cat /etc/passwd | grep craigdba
if [[ $? != 0 ]]; then
useradd -c "Craig Richards - Senior Oracle/Unix Admin" -m -d $HOMEDIR -s $SH $USER
chown $USER $HOMEDIR
fi
}
################
# Main Program #
################
# Variable Settings
NARG=$# ; export NARG
DATE=`date +"%d-%B-%Y"` ; export DATE
HOMEDIR=/export/home/craigdba ; export HOMEDIR
SH=/bin/ksh
USER=craigdba
# Oracle Environment
ORATAB_LOC=/etc/oratab ; export ORATAB_LOC
{
funct_check_user
funct_create_user
}
## End of Program