48 lines
1.6 KiB
Bash
48 lines
1.6 KiB
Bash
![]() |
#!/bin/bash
|
||
|
#
|
||
|
# This library is free software; you can redistribute it and/or modify it
|
||
|
# under the terms of the GNU Lesser General Public License as published by
|
||
|
# the Free Software Foundation; either version 2.1 of the License, or (at
|
||
|
# your option) any later version.
|
||
|
#
|
||
|
# This library is distributed in the hope that it will be useful, but
|
||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
# Lesser General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU Lesser General Public
|
||
|
# License along with this library; if not, write to the Free Software
|
||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||
|
#
|
||
|
|
||
|
# Default values - can be overwritten by /etc/sysconfig/request-tracker
|
||
|
RT_CACHEDIR='__RT_CACHEDIR__'
|
||
|
MASONSTATEDIR='__MASONSTATEDIR__'
|
||
|
SESSIONSTATEDIR='__SESSIONSTATEDIR__'
|
||
|
RT_LOGDIR='__RT_LOGDIR__'
|
||
|
RT_LOCALSTATEDIR='__RT_LOCALSTATEDIR__'
|
||
|
RT_SHREDDERDIR="$RT_LOCALSTATEDIR/data/RT-Shredder"
|
||
|
RT_USER='__RT_USER__'
|
||
|
RT_GROUP='__RT_GROUP__'
|
||
|
WEB_USER='wwwrun'
|
||
|
WEB_GROUP='www'
|
||
|
|
||
|
# File with user defined values
|
||
|
RT_SYSCONFIG='/etc/sysconfig/request-tracker'
|
||
|
|
||
|
if [ -r "$RT_SYSCONFIG" ]; then
|
||
|
. "$RT_SYSCONFIG"
|
||
|
else
|
||
|
echo "$RT_SYSCONFIG does not exist. Using default values."
|
||
|
fi
|
||
|
|
||
|
for dir in "$RT_CACHEDIR" "$MASONSTATEDIR" "$SESSIONSTATEDIR" "$RT_LOGDIR" "$RT_LOCALSTATEDIR" ; do
|
||
|
if [ ! -d "$dir" ]; then
|
||
|
/bin/mkdir -p "$dir"
|
||
|
/bin/chown $RT_USER:$RT_GROUP "$dir"
|
||
|
fi
|
||
|
done
|
||
|
/bin/mkdir -p "$RT_SHREDDERDIR" 2>/dev/null
|
||
|
/bin/chown $WEB_USER:$WEB_GROUP "$RT_SHREDDERDIR"
|
||
|
|