[Pkg-mono-svn-commits] rev 587 - xsp-snapshot/trunk/debian/official

Pablo Fischer pabl0-guest@haydn.debian.org
Fri, 16 Apr 2004 19:33:41 -0600


Author: pabl0-guest
Date: 2004-04-16 19:33:07 -0600 (Fri, 16 Apr 2004)
New Revision: 587

Added:
   xsp-snapshot/trunk/debian/official/mono-server-update.old
   xsp-snapshot/trunk/debian/official/mono-xsp-reader.old
   xsp-snapshot/trunk/debian/official/mono-xsp-update.old
Removed:
   xsp-snapshot/trunk/debian/official/mono-server-reader.conf
   xsp-snapshot/trunk/debian/official/mono-server-update.conf
   xsp-snapshot/trunk/debian/official/mono-xsp-reader.conf
   xsp-snapshot/trunk/debian/official/mono-xsp-update.conf
Log:
Renamed, I want to keep them, however, the newer scripts will be in perl, perl power!


Deleted: xsp-snapshot/trunk/debian/official/mono-server-reader.conf
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-server-reader.conf	2004-04-16 22:47:58 UTC (rev 586)
+++ xsp-snapshot/trunk/debian/official/mono-server-reader.conf	2004-04-17 01:33:07 UTC (rev 587)
@@ -1,127 +0,0 @@
-#!/bin/sh
-
-MONOSERVER_confdir="/etc/mono-server"
-MONOSERVER_conffile=$MONOSERVER_confdir/mono-server-hosts.conf
-MONOSERVER_validate=no
-
-usage() {
-    cat <<EOF
-$0 - Read the XSP Host Configuration
-  Options:
-     --help              - Show this message
-     --output file       - Read other host configuration file instead of ${MONOSERVER_conffile}
-EOF
-}
-
-
-#Read the commandline
-TEMP=$(getopt -n mono-xsp-reader.conf \
-    -l output:,help -- \
-    : "$@")
-
-
-eval set -- ${TEMP}
-while test "$1" != "--"; do
-    case $1 in
-	--help)
-	    usage
-	    exit 0
-	    ;;
-	--output)
-	    shift
-	    MONOSERVER_conffile="$1"
-	    ;;
-    esac
-    shift
-done
-shift
-
-opened_file=''
-opened_flag=0
-counter=0
-first_line='yes'
-
-
-section_alias=''
-section_path=''
-
-full_cmdline=''
-
-if [ ! -f $MONOSERVER_conffile ]; then
-    echo "Sorry, but you don't have $MONOSERVER_conffile, install a package, like asp.net-examples"
-    exit 1
-else 
-    if [ ! -e $MONOSERVER_conffile ]; then
-	echo "Sorry, but you don't have a $MONOSERVER_conffile, install a package, like asp.net-examples"
-	exit 1
-    fi
-fi
-
-for line in `cat $MONOSERVER_conffile | tr ' ' '~'`; do
-    line=`echo $line | tr '~' ' '`
-    if [[ $line = *begin* ]]; then
-	if [[ $opened_flag = "1" && $first_line = 'no' ]]; then
-	    echo "Sorry, you have a bad $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
-	    exit 1
-	fi
-	opened_file=`echo $line | awk '{print $3}'`
-	opened_flag=1
-	first_line='no'
-    fi
-    
-    if [[ $line = *end* ]]; then
-	closed_file=`echo $line | awk '{print $3}'`
-	if [[ $section_alias = '' || $section_path = '' ]]; then
-	    echo "Sorry, No path/alias found in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
-	    exit 1
-	fi
-
-	if [ $closed_file != $opened_file ]; then
-	    echo "Sorry, unopened section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
-	    exit 1
-	else
-	    opened_flag="0"
-	    full_cmdline="$full_cmdline$section_alias:$section_path,"
-	    section_alias=''
-	    section_path=''
-	fi
-
-	# Or maybe.. we don't have an open section
-	if [ $opened_flag = "1" ]; then
-	    echo "Sorry, unopened section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
-	    exit 1    
-	fi
-    fi	    
-
-    if [[ $line = *path* ]]; then
-	if [ $opened_flag = "1" ]; then
-	    if [ -z $section_path ]; then
-		section_path=`echo $line | awk '{print $3}'`	
-	    else
-		echo "Sorry, you have two paths in one section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
-		exit 1
-	    fi
-	else
-	    echo "Sorry, unopened section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
-	    exit 0
-	fi
-    fi
-
-    if [[ $line = *alias* ]]; then
-	if [ $opened_flag = "1" ]; then
-	    if [ -z $section_alias ]; then
-		section_alias=`echo $line | awk '{print $3}'`
-	    else
-		echo "Sorry, you have two alias in one section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
-		exit 1
-	    fi
-	else
-	    echo "Sorry, unopened section in $MONOSERVER_conffile, please re-run mono-server-update.conf to fix it"
-	    exit 1
-	fi
-    fi
-
-	
-done
-
-echo $full_cmdline | sed 's/,$//'

Deleted: xsp-snapshot/trunk/debian/official/mono-server-update.conf
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-server-update.conf	2004-04-16 22:47:58 UTC (rev 586)
+++ xsp-snapshot/trunk/debian/official/mono-server-update.conf	2004-04-17 01:33:07 UTC (rev 587)
@@ -1,181 +0,0 @@
-#!/bin/sh
-
-MONOSERVER_confdir="/etc/mono-server"
-MONOSERVER_conffile=$MONOSERVER_confdir/mono-server-hosts.conf
-MONOSERVER_comments=no
-MONOSERVER_restart=yes
-
-usage() {
-    cat <<EOF
-$0 - Generate the Mono Server Host Configuration
-  Options:
-     --help              - Show this message
-     --output file       - write the output to other file instead of ${MONOSERVER_conffile}
-     --confdir directory - read the configuration files in a directory instead of ${MONOSERVER_confdir}
-     --norestart         - Do not restart the daemon (by default, it will)
-EOF
-}
-
-#Read the commandline
-TEMP=$(getopt -n mono-server-update.conf \
-    -l output:,confdir:,norestart,help -- \
-    : "$@")
-
-
-eval set -- ${TEMP}
-while test "$1" != "--"; do
-    case $1 in
-	--help)
-	    usage
-	    exit 0
-	    ;;
-	--norestart)
-#	    shift
-	    MONOSERVER_restart="no"
-	    ;;
-	--output)
-	    shift
-	    MONOSERVER_conffile="$1"
-	    ;;
-	--confdir)
-	    shift
-	    MONOSERVER_confdir="$1"
-	    ;;
-	esac
-    shift
-done
-shift
-
-# No non-options arguments 
-if [ "$#" -ne 0 ]; then
-	echo "No non option arguments ($@) allowed" >&2
-	usage >&2
-	exit 1
-fi
-	    
-
-MONOSERVER_confd=$MONOSERVER_confdir/conf.d
-
-if [ ! -d ${MONOSERVER_confd} ]; then
-    printf "$0: Error, no ${MONOSERVER_confd} directory, exiting..\n" 1>&2 
-    exit 1 
-fi
-
-if [ ! -d `dirname $MONOSERVER_conffile ` ]; then
-    printf "$0: Error, missing `dirname $MONOSERVER_conffile` directory, exiting.\n" 1>&2 
-    exit 1
-fi
-
-if [ -e "$MONOSERVER_conffile" ]; then
-    md5_orig=`md5sum $MONOSERVER_conffile | awk '{print $1}'`
-else
-    md5_orig="0"
-fi
-
-
-# based on exim4-update.conf
-errormessage () {
-	# pretty-print messages of arbitrary length (no trailing newline)
-	echo "$*" | fold -s -w ${COLUMNS:-80} >&2;
-}
-
-restart_firsttime() {    
-    confd="${MONOSERVER_confd}"
-    almost_empty="`ls -lA $confd | wc -l`"
-    if [ "$almost_empty" = "2" ] ; then
-	echo "Starting Mono Server: mono-server"
-	/etc/init.d/mono-server start > /dev/null 2>&1 || true		
-    fi    
-}
-
-restart_monoserver() {
-    #Ok, include the default file
-    . "/etc/default/mono-server"
-    #MonoServer is running?
-    if [ -f /var/run/mono-server ]; then
-        # Are we really running xsp?
-	monoserver_pid=`cat /var/run/mono-server`
-	monoserver_ps=`ps -p $monoserver_pid | wc -l`
- 	# Are there any process running by that pid?
-	if [ "$xsp_ps" != "1" ]; then
-	    if [ "$start_boot" = "true" ]; then
-		echo "Restarting Mono Server: mono-server"
-		/etc/init.d/mono-server restart > /dev/null 2>&1 || true
-	    fi
-	else
-	    restart_firsttime
-	fi
-    else
-	if [ "$start_boot" = "true" ]; then
-	    restart_firsttime 
-	fi
-    fi
-}
-
-
-# stolen from /etc/X11/Xsession
-run_parts () {
-  # until run-parts --noexec is implemented
-  if [ -z "$1" ]; then
-      errormessage "run_parts() called without an argument."
-  fi
-  if [ ! -d "$1" ]; then
-      errormessage "run_parts() called, but \"$1\" does not exist or is" \
-	  "not a directory."
-  fi
-  for F in $(ls $1); do
-      if expr "$F" : '[[:alnum:]_-]\+$' > /dev/null 2>&1; then
-	  if [ -f "$1/$F" ]; then
-	      echo "$1/$F"
-	  fi
-      fi
-  done
-}
-
-
-# based on exim4-update.conf
-cat_parts() {
-    if [ -z "$1" ]; then
-	errormessage "$0: internal cat_parts called without an argument"
-    fi
-    if [ ! -d "$1" ]; then
-	errormessage "$0: internal cat_parts called, but $1 does not exist or is not a directory."
-    fi
-    for file in `run_parts $1`; do
-	echo "#####################################################"
-	echo "### begin $file"
-	echo "#####################################################"
-	cat $file 
-	echo "#####################################################"
-	echo "### end $file" 
-	echo "#####################################################"
-	echo ""	
-    done
-}
-
-
-gentmpconf() {
-	touch ${MONOSERVER_conffile}.tmp
-	chmod 640 ${MONOSERVER_conffile}.tmp
-	[ -e ${MONOSERVER_conffile} ] && chmod 640 ${MONOSERVER_conffile}
-}
-
-#Ok, we start here..
-gentmpconf
-for vhosts in `ls ${MONOSERVER_confd}`; do
-    cat_parts ${MONOSERVER_confd}/$vhosts
-done > ${MONOSERVER_conffile}.tmp
-
-mv -f ${MONOSERVER_conffile}.tmp ${MONOSERVER_conffile}
-chmod 644 ${MONOSERVER_conffile}
-
-#re-check the md5
-md5_new=`md5sum $MONOSERVER_conffile | awk '{print $1}'`
-
-#The orig and new.. are the same?
-if [ "$md5_new" != "$md5_orig" ]; then
-    #So, restart the server.. but.. should we?
-    if [ "${MONOSERVER_restart}" = "yes" ]; then
-	restart_monoserver
-    fi
-fi

Copied: xsp-snapshot/trunk/debian/official/mono-server-update.old (from rev 573, xsp-snapshot/trunk/debian/official/mono-server-update.conf)

Deleted: xsp-snapshot/trunk/debian/official/mono-xsp-reader.conf
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-xsp-reader.conf	2004-04-16 22:47:58 UTC (rev 586)
+++ xsp-snapshot/trunk/debian/official/mono-xsp-reader.conf	2004-04-17 01:33:07 UTC (rev 587)
@@ -1,128 +0,0 @@
-#!/bin/sh
-
-MONOXSP_confdir="/etc/xsp"
-MONOXSP_conffile=$MONOXSP_confdir/mono-xsp-hosts.conf
-MONOXSP_validate=no
-
-usage() {
-    cat <<EOF
-$0 - Read the XSP Host Configuration
-  Options:
-     --help              - Show this message
-     --output file       - Read other host configuration file instead of ${MONOXSP_conffile}
-EOF
-}
-
-
-#Read the commandline
-TEMP=$(getopt -n mono-xsp-reader.conf \
-    -l output:,help -- \
-    : "$@")
-
-
-eval set -- ${TEMP}
-while test "$1" != "--"; do
-    case $1 in
-	--help)
-	    usage
-	    exit 0
-	    ;;
-	--output)
-	    shift
-	    MONOXSP_conffile="$1"
-	    ;;
-    esac
-    shift
-done
-shift
-
-opened_file=''
-opened_flag=0
-counter=0
-first_line='yes'
-
-
-section_alias=''
-section_path=''
-
-full_cmdline=''
-
-if [ ! -f $MONOXSP_conffile ]; then
-    echo "Sorry, but you don't have $MONOXSP_conffile, install a package, like asp.net-examples"
-    exit 1
-else
-    if [ ! -e $MONOXSP_conffile ]; then
-        echo "Sorry, but you don't have a $MONOSERVER_conffile, install a package, like asp.net-examples"
-        exit 1
-    fi
-fi
-
-    
-for line in `cat $MONOXSP_conffile | tr ' ' '~'`; do
-    line=`echo $line | tr '~' ' '`
-    if [[ $line = *begin* ]]; then
-	if [[ $opened_flag = "1" && $first_line = 'no' ]]; then
-	    echo "Sorry, you have a bad $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
-	    exit 1
-	fi
-	opened_file=`echo $line | awk '{print $3}'`
-	opened_flag=1
-	first_line='no'
-    fi
-    
-    if [[ $line = *end* ]]; then
-	closed_file=`echo $line | awk '{print $3}'`
-	if [[ $section_alias = '' || $section_path = '' ]]; then
-	    echo "Sorry, No path/alias found in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
-	    exit 1
-	fi
-
-	if [ $closed_file != $opened_file ]; then
-	    echo "Sorry, unopened section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
-	    exit 1
-	else
-	    opened_flag="0"
-	    full_cmdline="$full_cmdline$section_alias:$section_path,"
-	    section_alias=''
-	    section_path=''
-	fi
-
-	# Or maybe.. we don't have an open section
-	if [ $opened_flag = "1" ]; then
-	    echo "Sorry, unopened section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
-	    exit 1    
-	fi
-    fi	    
-
-    if [[ $line = *path* ]]; then
-	if [ $opened_flag = "1" ]; then
-	    if [ -z $section_path ]; then
-		section_path=`echo $line | awk '{print $3}'`	
-	    else
-		echo "Sorry, you have two paths in one section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
-		exit 1
-	    fi
-	else
-	    echo "Sorry, unopened section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
-	    exit 0
-	fi
-    fi
-
-    if [[ $line = *alias* ]]; then
-	if [ $opened_flag = "1" ]; then
-	    if [ -z $section_alias ]; then
-		section_alias=`echo $line | awk '{print $3}'`
-	    else
-		echo "Sorry, you have two alias in one section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
-		exit 1
-	    fi
-	else
-	    echo "Sorry, unopened section in $MONOXSP_conffile, please re-run mono-xsp-update.conf to fix it"
-	    exit 1
-	fi
-    fi
-
-	
-done
-
-echo $full_cmdline | sed 's/,$//'

Copied: xsp-snapshot/trunk/debian/official/mono-xsp-reader.old (from rev 573, xsp-snapshot/trunk/debian/official/mono-xsp-reader.conf)

Deleted: xsp-snapshot/trunk/debian/official/mono-xsp-update.conf
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-xsp-update.conf	2004-04-16 22:47:58 UTC (rev 586)
+++ xsp-snapshot/trunk/debian/official/mono-xsp-update.conf	2004-04-17 01:33:07 UTC (rev 587)
@@ -1,180 +0,0 @@
-#!/bin/sh
-
-MONOXSP_confdir="/etc/xsp"
-MONOXSP_conffile=$MONOXSP_confdir/mono-xsp-hosts.conf
-MONOXSP_comments=no
-MONOXSP_restart=yes
-
-
-usage() {
-    cat <<EOF
-$0 - Generate the XSP Host Configuration
-  Options:
-     --help              - Show this message
-     --output file       - write the output to other file instead of ${MONOXSP_conffile}
-     --confdir directory - read the configuration files in a directory instead of ${MONOXSP_confdir}
-     --norestart         - Do not restart the daemon (by default, it will)
-EOF
-}
-
-#Read the commandline
-TEMP=$(getopt -n mono-xsp-update.conf \
-    -l output:,confdir:,norestart,help -- \
-    : "$@")
-
-
-eval set -- ${TEMP}
-while test "$1" != "--"; do
-    case $1 in
-	--help)
-	    usage
-	    exit 0
-	    ;;
-	--norestart)
-#	    shift
-	    MONOXSP_restart="no"
-	    ;;
-	--output)
-	    shift
-	    MONOXSP_conffile="$1"
-	    ;;
-	--confdir)
-	    shift
-	    MONOXSP_confdir="$1"
-	    ;;
-	esac
-    shift
-done
-shift
-
-# No non-options arguments 
-if [ "$#" -ne 0 ]; then
-	echo "No non option arguments ($@) allowed" >&2
-	usage >&2
-	exit 1
-fi
-	    
-
-MONOXSP_confd=$MONOXSP_confdir/conf.d
-
-if [ ! -d ${MONOXSP_confd} ]; then
-    printf "$0: Error, no ${MONOXSP_confd} directory, exiting..\n" 1>&2 
-    exit 1 
-fi
-
-if [ ! -d `dirname $MONOXSP_conffile ` ]; then
-    printf "$0: Error, missing `dirname $MONOXSP_conffile` directory, exiting.\n" 1>&2 
-    exit 1
-fi
-
-if [ -e "$MONOXSP_conffile" ]; then
-    md5_orig=`md5sum $MONOXSP_conffile | awk '{print $1}'`
-else
-    md5_orig="0"
-fi
-
-# based on exim4-update.conf
-errormessage () {
-	# pretty-print messages of arbitrary length (no trailing newline)
-	echo "$*" | fold -s -w ${COLUMNS:-80} >&2;
-}
-
-restart_firsttime() {    
-    confd="${MONOXSP_confd}"
-    almost_empty="`ls -lA $confd | wc -l`"
-    if [ "$almost_empty" = "2" ] ; then
-	echo "Starting XSP WebServer: mono-xsp"
-	/etc/init.d/mono-xsp start > /dev/null 2>&1 || true		
-    fi    
-}
-
-restart_xsp() {
-    #Ok, include the default file
-    . "/etc/default/mono-xsp"
-    #MonoServer is running?
-    if [ -f /var/run/mono-xsp ]; then
-        # Are we really running xsp?
-	xsp_pid=`cat /var/run/mono-xsp`
-	xsp_ps=`ps -p $xsp_pid | wc -l`
- 	# Are there any process running by that pid?
-	if [ "$xsp_ps" != "1" ]; then
-	    if [ "$start_boot" = "true" ]; then
-		echo "Restarting XSP WebServer: mono-xsp"
-		/etc/init.d/mono-xsp restart > /dev/null 2>&1 || true
-	    fi
-	else
-	    restart_firsttime
-	fi
-    else
-	if [ "$start_boot" = "true" ]; then
-	    restart_firsttime 
-	fi
-    fi
-}
-
-# stolen from /etc/X11/Xsession
-run_parts () {
-  # until run-parts --noexec is implemented
-  if [ -z "$1" ]; then
-      errormessage "run_parts() called without an argument."
-  fi
-  if [ ! -d "$1" ]; then
-      errormessage "run_parts() called, but \"$1\" does not exist or is" \
-	  "not a directory."
-  fi
-  for F in $(ls $1); do
-      if expr "$F" : '[[:alnum:]_-]\+$' > /dev/null 2>&1; then
-	  if [ -f "$1/$F" ]; then
-	      echo "$1/$F"
-	  fi
-      fi
-  done
-}
-
-
-# based on exim4-update.conf
-cat_parts() {
-    if [ -z "$1" ]; then
-	errormessage "$0: internal cat_parts called without an argument"
-    fi
-    if [ ! -d "$1" ]; then
-	errormessage "$0: internal cat_parts called, but $1 does not exist or is not a directory."
-    fi
-    for file in `run_parts $1`; do
-	echo "#####################################################"
-	echo "### begin $file"
-	echo "#####################################################"
-	cat $file 
-	echo "#####################################################"
-	echo "### end $file" 
-	echo "#####################################################"
-	echo ""	
-    done
-}
-
-
-gentmpconf() {
-	touch ${MONOXSP_conffile}.tmp
-	chmod 640 ${MONOXSP_conffile}.tmp
-	[ -e ${MONOXSP_conffile} ] && chmod 640 ${MONOXSP_conffile}
-}
-
-#Ok, we start here..
-gentmpconf
-for vhosts in `ls ${MONOXSP_confd}`; do
-    cat_parts ${MONOXSP_confd}/$vhosts
-done > ${MONOXSP_conffile}.tmp
-
-mv -f ${MONOXSP_conffile}.tmp ${MONOXSP_conffile}
-chmod 644 ${MONOXSP_conffile}
-
-#re-check the md5
-md5_new=`md5sum $MONOXSP_conffile | awk '{print $1}'`
-
-#The orig and new.. are the same?
-if [ "$md5_new" != "$md5_orig" ]; then
-    #So, restart the server.. but.. should we?
-    if [ "${MONOXSP_restart}" = "yes" ]; then
-	restart_xsp
-    fi
-fi

Copied: xsp-snapshot/trunk/debian/official/mono-xsp-update.old (from rev 573, xsp-snapshot/trunk/debian/official/mono-xsp-update.conf)
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-xsp-update.conf	2004-04-15 22:51:02 UTC (rev 573)
+++ xsp-snapshot/trunk/debian/official/mono-xsp-update.old	2004-04-17 01:33:07 UTC (rev 587)
@@ -0,0 +1,181 @@
+#!/bin/sh
+
+MONOXSP_confdir="/etc/xsp"
+MONOXSP_conffile=$MONOXSP_confdir/mono-xsp-hosts.conf
+MONOXSP_comments=no
+MONOXSP_restart=yes
+
+
+usage() {
+    cat <<EOF
+$0 - Generate the XSP Host Configuration
+  Options:
+     --help              - Show this message
+     --output file       - write the output to other file instead of ${MONOXSP_conffile}
+     --confdir directory - read the configuration files in a directory instead of ${MONOXSP_confdir}
+     --norestart         - Do not restart the daemon (by default, it will)
+EOF
+}
+
+#Read the commandline
+TEMP=$(getopt -n mono-xsp-update.conf \
+    -l output:,confdir:,norestart,help -- \
+    : "$@")
+
+
+eval set -- ${TEMP}
+while test "$1" != "--"; do
+    case $1 in
+	--help)
+	    usage
+	    exit 0
+	    ;;
+	--norestart)
+#	    shift
+	    MONOXSP_restart="no"
+	    ;;
+	--output)
+	    shift
+	    MONOXSP_conffile="$1"
+	    ;;
+	--confdir)
+	    shift
+	    MONOXSP_confdir="$1"
+	    ;;
+	esac
+    shift
+done
+shift
+
+# No non-options arguments 
+if [ "$#" -ne 0 ]; then
+    echo "Si aja"
+	echo "No non option arguments ($@) allowed" >&2
+	usage >&2
+	exit 1
+fi
+	    
+
+MONOXSP_confd=$MONOXSP_confdir/conf.d
+
+if [ ! -d ${MONOXSP_confd} ]; then
+    printf "$0: Error, no ${MONOXSP_confd} directory, exiting..\n" 1>&2 
+    exit 1 
+fi
+
+if [ ! -d `dirname $MONOXSP_conffile ` ]; then
+    printf "$0: Error, missing `dirname $MONOXSP_conffile` directory, exiting.\n" 1>&2 
+    exit 1
+fi
+
+if [ -e "$MONOXSP_conffile" ]; then
+    md5_orig=`md5sum $MONOXSP_conffile | awk '{print $1}'`
+else
+    md5_orig="0"
+fi
+
+# based on exim4-update.conf
+errormessage () {
+	# pretty-print messages of arbitrary length (no trailing newline)
+	echo "$*" | fold -s -w ${COLUMNS:-80} >&2;
+}
+
+restart_firsttime() {    
+    confd="${MONOXSP_confd}"
+    almost_empty="`ls -lA $confd | wc -l`"
+    if [ "$almost_empty" = "2" ] ; then
+	echo "Starting XSP WebServer: mono-xsp"
+	/etc/init.d/mono-xsp start > /dev/null 2>&1 || true		
+    fi    
+}
+
+restart_xsp() {
+    #Ok, include the default file
+    . "/etc/default/mono-xsp"
+    #MonoServer is running?
+    if [ -f /var/run/mono-xsp ]; then
+        # Are we really running xsp?
+	xsp_pid=`cat /var/run/mono-xsp`
+	xsp_ps=`ps -p $xsp_pid | wc -l`
+ 	# Are there any process running by that pid?
+	if [ "$xsp_ps" != "1" ]; then
+	    if [ "$start_boot" = "true" ]; then
+		echo "Restarting XSP WebServer: mono-xsp"
+		/etc/init.d/mono-xsp restart > /dev/null 2>&1 || true
+	    fi
+	else
+	    restart_firsttime
+	fi
+    else
+	if [ "$start_boot" = "true" ]; then
+	    restart_firsttime 
+	fi
+    fi
+}
+
+# stolen from /etc/X11/Xsession
+run_parts () {
+  # until run-parts --noexec is implemented
+  if [ -z "$1" ]; then
+      errormessage "run_parts() called without an argument."
+  fi
+  if [ ! -d "$1" ]; then
+      errormessage "run_parts() called, but \"$1\" does not exist or is" \
+	  "not a directory."
+  fi
+  for F in $(ls $1); do
+      if expr "$F" : '[[:alnum:]_-]\+$' > /dev/null 2>&1; then
+	  if [ -f "$1/$F" ]; then
+	      echo "$1/$F"
+	  fi
+      fi
+  done
+}
+
+
+# based on exim4-update.conf
+cat_parts() {
+    if [ -z "$1" ]; then
+	errormessage "$0: internal cat_parts called without an argument"
+    fi
+    if [ ! -d "$1" ]; then
+	errormessage "$0: internal cat_parts called, but $1 does not exist or is not a directory."
+    fi
+    for file in `run_parts $1`; do
+	echo "#####################################################"
+	echo "### begin $file"
+	echo "#####################################################"
+	cat $file 
+	echo "#####################################################"
+	echo "### end $file" 
+	echo "#####################################################"
+	echo ""	
+    done
+}
+
+
+gentmpconf() {
+	touch ${MONOXSP_conffile}.tmp
+	chmod 640 ${MONOXSP_conffile}.tmp
+	[ -e ${MONOXSP_conffile} ] && chmod 640 ${MONOXSP_conffile}
+}
+
+#Ok, we start here..
+gentmpconf
+for vhosts in `ls ${MONOXSP_confd}`; do
+    cat_parts ${MONOXSP_confd}/$vhosts
+done > ${MONOXSP_conffile}.tmp
+
+mv -f ${MONOXSP_conffile}.tmp ${MONOXSP_conffile}
+chmod 644 ${MONOXSP_conffile}
+
+#re-check the md5
+md5_new=`md5sum $MONOXSP_conffile | awk '{print $1}'`
+
+#The orig and new.. are the same?
+if [ "$md5_new" != "$md5_orig" ]; then
+    #So, restart the server.. but.. should we?
+    if [ "${MONOXSP_restart}" = "yes" ]; then
+	restart_xsp
+    fi
+fi