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
|
|
|
|
|
|
|
|
#NOTE: We need Perl 5, to generate a new key
|
|
|
|
if [ -x ${PERL} ]
|
|
|
|
then
|
2000-01-03 03:36:38 +00:00
|
|
|
umask 077
|
1998-11-10 01:56:01 +00:00
|
|
|
${PERL} -e '@a=(split(//, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*-=_+")); print((map {$a[rand(scalar @a)]} (1..128)), "\n");' > $skdir/suidkey
|
2000-01-03 03:36:38 +00:00
|
|
|
umask ${CUR_UMASK}
|
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
|
|
|
|
MODULES="fp"
|
|
|
|
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
|