#!/bin/bash
### BEGIN INIT INFO
# Provides:          sipb-xen-console
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: sipb-xen Console Server homedir filesystem
# Description:       
### END INIT INFO

# Author: SIPB Xen Project <sipb-xen@mit.edu>

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="The sipb-xen database server"
NAME=sipb-xen-database-server



SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "/usr/bin/sipb-xen-database-tabales" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

gen_config()
{
    for i in /etc/postgresql/8.1/main/pg_hba.conf
             ; do
        mako-render $i.mako > $i
    done
}

do_reload()
{
	gen_config

}

case "$1" in
  start)
	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
gen_config
	;;
  stop)
	;;
  reload|force-reload)
	log_daemon_msg "Reloading $DESC" "$NAME"
	do_reload
	log_end_msg $?
	;;
  restart)
	  *)
	  	# Failed to stop
		log_end_msg 1
		;;
	esac
	;;
  *)
	echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
	exit 3
	;;
esac

:
