| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
RunUser=firebird |
| 4 |
export RunUser |
| 5 |
RunGroup=firebird |
| 6 |
export RunGroup |
| 7 |
PidDir=/var/run/firebird |
| 8 |
export PidDir |
| 9 |
|
| 10 |
#------------------------------------------------------------------------ |
| 11 |
# Get correct options & misc. |
| 12 |
|
| 13 |
tarExt=tar |
| 14 |
export tarExt |
| 15 |
|
| 16 |
#------------------------------------------------------------------------ |
| 17 |
# Add new user and group |
| 18 |
|
| 19 |
TryAddGroup() { |
| 20 |
|
| 21 |
AdditionalParameter=$1 |
| 22 |
testStr=`grep firebird /etc/group` |
| 23 |
|
| 24 |
if [ -z "$testStr" ] |
| 25 |
then |
| 26 |
groupadd $AdditionalParameter firebird |
| 27 |
fi |
| 28 |
|
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
TryAddUser() { |
| 33 |
|
| 34 |
AdditionalParameter=$1 |
| 35 |
testStr=`grep firebird /etc/passwd` |
| 36 |
|
| 37 |
if [ -z "$testStr" ] |
| 38 |
then |
| 39 |
useradd $AdditionalParameter -d @FB_CONFDIR@ -s /bin/false \ |
| 40 |
-c "Firebird Database Owner" -g firebird firebird |
| 41 |
fi |
| 42 |
|
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
addFirebirdUser() { |
| 47 |
|
| 48 |
TryAddGroup "-g 84 -r" >/dev/null 2>&1 |
| 49 |
TryAddGroup "-g 84" >/dev/null 2>&1 |
| 50 |
TryAddGroup "-r" >/dev/null 2>&1 |
| 51 |
TryAddGroup " " |
| 52 |
|
| 53 |
TryAddUser "-u 84 -r" >/dev/null 2>&1 |
| 54 |
TryAddUser "-u 84" >/dev/null 2>&1 |
| 55 |
TryAddUser "-r" >/dev/null 2>&1 |
| 56 |
TryAddUser " " |
| 57 |
|
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
#------------------------------------------------------------------------ |
| 62 |
# print location of init script |
| 63 |
|
| 64 |
getInitScriptLocation() { |
| 65 |
if [ -f /etc/rc.d/init.d/firebird ] |
| 66 |
then |
| 67 |
echo -n /etc/rc.d/init.d/firebird |
| 68 |
elif [ -f /etc/rc.d/rc.firebird ] |
| 69 |
then |
| 70 |
echo -n /etc/rc.d/rc.firebird |
| 71 |
elif [ -f /etc/init.d/firebird ] |
| 72 |
then |
| 73 |
echo -n /etc/init.d/firebird |
| 74 |
fi |
| 75 |
} |
| 76 |
|
| 77 |
|
| 78 |
#------------------------------------------------------------------------ |
| 79 |
# stop super server if it is running |
| 80 |
|
| 81 |
stopSuperServerIfRunning() { |
| 82 |
checkString=`ps -eaf | egrep "\b(fbserver|fbguard)\b" |grep -v grep` |
| 83 |
|
| 84 |
if [ ! -z "$checkString" ] |
| 85 |
then |
| 86 |
init_d=`getInitScriptLocation` |
| 87 |
|
| 88 |
if [ -x "$init_d" ] |
| 89 |
then |
| 90 |
$init_d stop |
| 91 |
fi |
| 92 |
fi |
| 93 |
} |
| 94 |
|
| 95 |
#----------------------------------------------------------------------- |
| 96 |
# Blank stub on HPUX - don't use openssl |
| 97 |
|
| 98 |
generateNewDBAPassword() { |
| 99 |
return 0 |
| 100 |
} |
| 101 |
|