redhat-postinstall.sh 1.02 KB
Newer Older
1 2 3 4
#!/bin/sh

# redhat-poinstall.sh
#
5
# This script sets permissions on the Openfire installtion
6 7
# and install the init script.
#
8
# Run this script as root after installation of openfire
9 10 11 12
# It is expected that you are executing this script from the bin directory

# If you used an non standard directory name of location
# Please specify it here
13
# OPENFIRE_HOME=
14
 
15 16
OPENFIRE_USER="jive"
OPENFIRE_GROUP="jive"
17

18
if [ ! $OPENFIRE_HOME ]; then
Gaston Dombiak's avatar
Gaston Dombiak committed
19 20 21 22
	if [ -d "/opt/openfire" ]; then
		OPENFIRE_HOME="/opt/openfire"
	elif [ -d "/usr/local/openfire" ]; then
		OPENFIRE_HOME="/usr/local/openfire"
23 24 25
	fi
fi

Gaston Dombiak's avatar
Gaston Dombiak committed
26
# Grant execution permissions 
27
chmod +x $OPENFIRE_HOME/bin/extra/openfired
28

29
# Install the init script
30 31 32
cp $OPENFIRE_HOME/bin/extra/openfired /etc/init.d
/sbin/chkconfig --add openfired
/sbin/chkconfig openfired on
33 34

# Create the jive user and group
35 36
/usr/sbin/groupadd $OPENFIRE_GROUP
/usr/sbin/useradd $OPENFIRE_USER -g $OPENFIRE_GROUP -s /bin/bash
37 38

# Change the permissions on the installtion directory
39
/bin/chown -R $OPENFIRE_USER:$OPENFIRE_GROUP $OPENFIRE_HOME