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

# redhat-poinstall.sh
#
5
# This script sets permissions on the Wildfire installtion
6 7
# and install the init script.
#
8
# Run this script as root after installation of wildfire
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
# WILDFIRE_HOME=
14
 
15 16
WILDFIRE_USER="jive"
WILDFIRE_GROUP="jive"
17

18 19 20 21 22
if [ ! $WILDFIRE_HOME ]; then
	if [ -d "/opt/wildfire" ]; then
		WILDFIRE_HOME="/opt/wildfire"
	elif [ -d "/usr/local/wildfire" ]; then
		WILDFIRE_HOME="/usr/local/wildfire"
23 24 25
	fi
fi

26
# Grant execution permissions
27
chmod +x $WILDFIRE_HOME/bin/extra/wildfired
28

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

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

# Change the permissions on the installtion directory
39
/bin/chown -R $WILDFIRE_USER:$WILDFIRE_GROUP $WILDFIRE_HOME