File: //scripts.20110531.215904.25158/initfpsuexec
#!/bin/sh
# cpanel12 - scripts Copyright(c) 1997-2007 cPanel, Inc.
# All rights Reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cpanel license. Unauthorized copying is prohibited
#need a better test for ap2
if [ -e "/usr/local/apache/modules/mod_auth_passthrough.so" ]; then
echo "initfpsuexec: using apache 2.x support"
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;chflags noschg _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;chattr -i _vti_bin/fpexe)
fi
cp -f /scripts/fp-auth /usr/local/frontpage/version5.0/apache-fp/_vti_bin/fpexe
chmod 755 /usr/local/frontpage/version5.0/apache-fp/_vti_bin/fpexe
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;chflags schg _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;chattr +i _vti_bin/fpexe)
fi
exit 0
fi
echo "initfpsuexec: using apache 1.x support"
if [ -e "/usr/local/apache/libexec/mod_auth_passthrough.so" ]; then
cp -f /scripts/fp-auth /usr/local/frontpage/version5.0/apache-fp/fp-auth
chmod 755 /usr/local/frontpage/version5.0/apache-fp/fp-auth
fi
RECOMPILE=0
if [ -e "/usr/local/apache/bin/suexec" ]; then
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;chflags noschg _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;chattr -i _vti_bin/fpexe)
fi
if [ -e "/usr/local/apache/libexec/mod_auth_passthrough.so" -o -e "/usr/local/apache/modules/mod_auth_passthrough.so" ]; then
if [ "`grep -i fp-auth /usr/local/frontpage/version5.0/apache-fp/_vti_bin/fpexe`" = "" ]; then
RECOMPILE=1
fi
if [ "`grep -i darkorbv3 /usr/local/frontpage/version5.0/apache-fp/_vti_bin/fpexe`" = "" ]; then
RECOMPILE=1
fi
if [ "$RECOMPILE" = "1" ]; then
/scripts/fetchfpexec -c
/scripts/fpsuexec3 -c
(cd /usr/local/frontpage/version5.0/apache-fp;patch -p0 < fpexe3-suexec.patch)
/scripts/checkccompiler
echo "Using Frontpage Passthough with suexec"
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;gcc -DFREEBSD fpexe.c -o _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;gcc fpexe.c -o _vti_bin/fpexe)
fi
fi
else
if [ "`grep -i darkorbv2 /usr/local/frontpage/version5.0/apache-fp/_vti_bin/fpexe`" = "" ]; then
/scripts/fetchfpexec -c
/scripts/fpsuexec2 -c
(cd /usr/local/frontpage/version5.0/apache-fp;patch -p0 < fpexe2.patch)
/scripts/checkccompiler
echo "Using Frontpage with suexec"
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;gcc -DFREEBSD fpexe.c -o _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;gcc fpexe.c -o _vti_bin/fpexe)
fi
fi
fi
(cd /usr/local/frontpage/version5.0/apache-fp;chown -R root:10 _vti_bin)
(cd /usr/local/frontpage/version5.0/apache-fp;chmod 755 _vti_bin/fpexe)
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;chflags schg _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;chattr +i _vti_bin/fpexe)
fi
chmod 4755 /usr/local/apache/bin/suexec
else
if [ -e "/usr/local/apache/libexec/mod_auth_passthrough.so" -o -e "/usr/local/apache/modules/mod_auth_passthrough.so" ]; then
if [ "`grep -i fp-auth /usr/local/frontpage/version5.0/apache-fp/_vti_bin/fpexe`" = "" ]; then
RECOMPILE=1
fi
if [ "`grep -i darkorb /usr/local/frontpage/version5.0/apache-fp/_vti_bin/fpexe`" != "" ]; then
RECOMPILE=1
fi
if [ "$RECOMPILE" = "1" ]; then
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;chflags noschg _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;chattr -i _vti_bin/fpexe)
fi
/scripts/fetchfpexec -c
/scripts/fp3 -c
/scripts/checkccompiler
echo "Using Frontpage Passthough without suexec"
(cd /usr/local/frontpage/version5.0/apache-fp;patch -p0 < fpexe3.patch)
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;gcc -DFREEBSD fpexe.c -o _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;gcc fpexe.c -o _vti_bin/fpexe)
fi
(cd /usr/local/frontpage/version5.0/apache-fp;chown -R root _vti_bin)
(cd /usr/local/frontpage/version5.0/apache-fp;chmod 4755 _vti_bin/fpexe)
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;chflags schg _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;chattr +i _vti_bin/fpexe)
fi
fi
else
if [ "`grep -i fp-auth /usr/local/frontpage/version5.0/apache-fp/_vti_bin/fpexe`" != "" ]; then
RECOMPILE=1
fi
if [ "`grep -i darkorb /usr/local/frontpage/version5.0/apache-fp/_vti_bin/fpexe`" != "" ]; then
RECOMPILE=1
fi
if [ "$RECOMPILE" = "1" ]; then
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;chflags noschg _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;chattr -i _vti_bin/fpexe)
fi
/scripts/fetchfpexec -c
/scripts/checkccompiler
echo "Using Frontpage without suexec"
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;gcc -DFREEBSD fpexe.c -o _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;gcc fpexe.c -o _vti_bin/fpexe)
fi
(cd /usr/local/frontpage/version5.0/apache-fp;chown -R root _vti_bin)
(cd /usr/local/frontpage/version5.0/apache-fp;chmod 4755 _vti_bin/fpexe)
if [ "`uname -s`" = "FreeBSD" ]; then
(cd /usr/local/frontpage/version5.0/apache-fp;chflags schg _vti_bin/fpexe)
else
(cd /usr/local/frontpage/version5.0/apache-fp;chattr +i _vti_bin/fpexe)
fi
fi
fi
fi
exit 0