1998-11-10 01:56:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Create New FrontPage suidkey
|
|
|
|
#
|
|
|
|
|
|
|
|
new_key() {
|
|
|
|
|
2000-01-03 03:36:38 +00:00
|
|
|
CUR_UMASK=`umask`
|
|
|
|
skdir=PREFIX/frontpage/version4.0/apache-fp
|
1998-11-10 01:56:01 +00:00
|
|
|
PERL=PERL5
|
|
|
|
|
2000-03-01 06:25:15 +00:00
|
|
|
if [ -x PREFIX/libexec/apache/mod_frontpage.so ]
|
1998-11-10 01:56:01 +00:00
|
|
|
then
|
2000-03-01 06:25:15 +00:00
|
|
|
|
|
|
|
#NOTE: We need Perl 5, to generate a new key
|
|
|
|
if [ -x ${PERL} ]
|
|
|
|
then
|
|
|
|
umask 077
|
|
|
|
${PERL} -e '@a=(split(//, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*-=_+")); print((map {$a[rand(scalar @a)]} (1..128)), "\n");' > $skdir/suidkey
|
|
|
|
umask ${CUR_UMASK}
|
|
|
|
fi
|
1998-11-10 01:56:01 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Main
|
|
|
|
#
|
|
|
|
|
1999-01-26 02:27:31 +00:00
|
|
|
if [ -x PREFIX/libexec/apache/mod_frontpage.so ]
|
|
|
|
then
|
2000-03-01 06:25:15 +00:00
|
|
|
MODULES="_FP"
|
1999-01-26 02:27:31 +00:00
|
|
|
fi
|
|
|
|
|
1998-11-10 01:56:01 +00:00
|
|
|
case "$1" in
|
|
|
|
|
|
|
|
start)
|
|
|
|
if [ -x PREFIX/sbin/apachectl ]
|
|
|
|
then
|
|
|
|
new_key
|
1999-01-26 02:27:31 +00:00
|
|
|
PREFIX/sbin/apachectl start${MODULES} && echo -n ' httpd'
|
1998-11-10 01:56:01 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
stop)
|
|
|
|
if [ -r /var/run/httpd.pid ]
|
|
|
|
then
|
|
|
|
PREFIX/sbin/apachectl stop && echo -n ' httpd'
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "usage: $0 {start|stop}" 1>&2
|
|
|
|
exit 64
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|