removed some preinst stuff which may have caused #1996

This commit is contained in:
fgerlits 2006-11-22 15:53:38 +00:00
parent b434016602
commit 9cd9d86218
1 changed files with 1 additions and 75 deletions

View File

@ -14,84 +14,10 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#-------------------------------------------------------------------------------
# Function to check for a group to be available, and the ability
# to set files to belong into that group
#
# @param $1 the group to check
# @return 0 if the groups id OK, non-0 otherwise
#-------------------------------------------------------------------------------
check_group_permission() {
group_tmp_file=/tmp/ls_group_check.$$
touch $group_tmp_file
test_result=`chgrp $1 $group_tmp_file 2> /dev/null`
if [ $? != 0 ]; then
rm -f $group_tmp_file;
echo "Unable to use apache deamon group $1.";
echo "Please check if $1 is a correct user group.";
return 1;
fi
rm -f $group_tmp_file;
echo "Apache daemon group $1 OK.";
return 0;
}
#-------------------------------------------------------------------------------
# Function to check for the existence of an executable on the PATH
#
# @param $1 the name of the exectuable
# @return 0 if the executable exists on the PATH, non-0 otherwise
#-------------------------------------------------------------------------------
check_exe() {
if [ -x "`which $1 2> /dev/null`" ]; then
echo "Exectuable $1 found...";
return 0;
else
echo "Exectuable $1 not found...";
return 1;
fi
}
#-------------------------------------------------------------------------------
# Function to check for a PEAR module
#
# @param $1 the name of the PEAR module
# @return 0 if the module is available, non-0 otherwise
#-------------------------------------------------------------------------------
check_pear_module() {
test_result=`pear info $1`
if [ $? = 0 ]; then
echo "PEAR module $1 found...";
return 0;
else
echo "PEAR module $1 not found...";
return 1;
fi
}
#-------------------------------------------------------------------------------
# Variables
#-------------------------------------------------------------------------------
apache_group=www-data
case "$1" in
install|upgrade)
echo "Checking for required tools..."
check_exe "sed" || exit 1;
check_exe "psql" || exit 1;
check_exe "php" || exit 1;
check_exe "pear" || exit 1;
check_exe "odbcinst" || exit 1;
echo "Checking for validity of apache daemon group $apache_group...";
check_group_permission $apache_group || exit 1;
if [ "$1" = "upgrade" ]; then
echo "Stopping the campcaster-scheduler daemon..."
/etc/init.d/campcaster-scheduler stop || true
/etc/init.d/campcaster-scheduler kill || true
fi