[Eisfair] minihttp startet nicht ganz

Jürgen Bombelczyk bludworscht at gmx.de
Fr Sep 8 15:05:56 CEST 2017


#!/bin/sh
#------------------------------------------------------------------------------
# /etc/init.d/mini_httpd - start/stop script of mini_httpd
#
# Copyright (c) 2003-2010 Marcus Herleb, info(at)herleb(dot).de
# Copyright (c) 2011-2016 The Eisfair Team, team(at)eisfair(dot)org
#
# Creation:     2003-05-02 mh
# Last Update:  $Id: mini_httpd 40420 2016-02-01 10:32:32Z jed $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#------------------------------------------------------------------------------

. /etc/init.d/functions

#exec 2>/tmp/mini_httpd-trace-$$.log
#set -x

#------------------------------------------------------------------------------
# show help
#------------------------------------------------------------------------------
print_help()
{
     echo "Usage: $0 [--debug][--quiet] 
start|forcestart|stop|restart|status"
     exit 1
}

#==============================================================================
# main
#==============================================================================

module_name="mini_httpd"
mini_httpd_conf_file=/etc/httpd/${module_name}.conf
mini_httpd_pid_file=/var/run/${module_name}.pid

. /etc/config.d/${module_name}

# get parameters
debug=''

while [ 1 ]
do
     case "$1" in
         '-debug'|'--debug')
             # debug mode
             MINI_HTTPD_DO_DEBUG='yes'
             shift
             ;;
         '-help'|'--help'|'-?'|'/?')
             # show help
             print_help
             exit 1
             ;;
         '-quiet'|'--quiet')
             # suppress output
             _quiet=true
             shift
             ;;
         *)
             break
             ;;
     esac
done

case "$1" in
     ch)
         rm -f /usr/local/htdocs/index.html
         echo "<html>" >> /usr/local/htdocs/index.html
         echo "<head><title>Weiterleitung</title>" >> 
/usr/local/htdocs/index.html

         if [ "${MINI_HTTPD_HEADER}" = 'yes' ]
         then
             il='index.cgi'
         else
             il='index.cgi?top=off'
         fi

         {
             echo '<meta http-equiv="refresh" content="0; url='${il}'">'
             echo '</head><body>'
             echo '<center><a href="'${il}'"><img src="umleitung.gif" 
border="0"></a></center>'
             echo '</body></html>'
         } > /usr/local/htdocs/index.html
         ;;

     start|forcestart)
         if [ "$1" = "forcestart" ]
         then
             START_MINI_HTTPD='yes'
         fi

         if [ "${START_MINI_HTTPD}" = 'yes' ]
         then
             boot_mesg " * Starting Mini_HTTPD-Webserver ..."

             if [ "${MINI_HTTPD_LOGFILE}" != 'none' -a ! -f 
${MINI_HTTPD_LOGFILE} ]
             then
                 # create empty logfile
                 touch ${MINI_HTTPD_LOGFILE}
                 chmod 640 ${MINI_HTTPD_LOGFILE}
             fi

             mini_httpd_opts=''
             if [ "${MINI_HTTPD_DO_DEBUG}" = 'yes' ]
             then
                 # enable debug mode
                 mini_httpd_opts="${mini_httpd_opts} -D"
             fi

             #        executable          conf-file                  opts
             loadproc /usr/sbin/mini_httpd -C ${mini_httpd_conf_file} 
${mini_httpd_opts} 2> /dev/null
         fi
         ;;

     stop)
         boot_mesg " * Stopping Mini_HTTPD-Webserver ..."
         /sbin/killproc ${module_name} 2> /dev/null
         sleep 3
         rm -f ${mini_httpd_pid_file}
         ;;

     restart)
         $0 stop
         $0 start
         ;;

     status)
         statusproc ${module_name}
         ;;

     *)
         print_help
         ;;
esac

#==============================================================================
# end
#==============================================================================
exit 0



Mehr Informationen über die Mailingliste Eisfair