mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 01:23:03 +01:00
47 lines
829 B
Bash
47 lines
829 B
Bash
#!/bin/sh
|
|
|
|
#------------------------------------------------------------------------
|
|
# Add new user and group
|
|
|
|
TryAddGroup() {
|
|
|
|
AdditionalParameter=$1
|
|
testStr=`grep firebird /etc/group`
|
|
|
|
if [ -z "$testStr" ]
|
|
then
|
|
groupadd $AdditionalParameter firebird
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
TryAddUser() {
|
|
|
|
AdditionalParameter=$1
|
|
testStr=`grep firebird /etc/passwd`
|
|
|
|
if [ -z "$testStr" ]
|
|
then
|
|
useradd $AdditionalParameter -M -d $FBRootDir -s /bin/false \
|
|
-c "Firebird Database Owner" -g firebird firebird
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
addFirebirdUser() {
|
|
|
|
TryAddGroup "-g 84 -r" >/dev/null 2>&1
|
|
TryAddGroup "-g 84" >/dev/null 2>&1
|
|
TryAddGroup "-r" >/dev/null 2>&1
|
|
TryAddGroup " "
|
|
|
|
TryAddUser "-u 84 -r" >/dev/null 2>&1
|
|
TryAddUser "-u 84" >/dev/null 2>&1
|
|
TryAddUser "-r" >/dev/null 2>&1
|
|
TryAddUser " "
|
|
|
|
}
|
|
|