-#! /bin/sh
+#! /bin/bash
### BEGIN INIT INFO
# Provides: invirt-console-host
# Required-Start: $local_fs $remote_fs
PACKAGE=invirt-console-host
PARENTPACKAGE=conserver-server
+GEN_FILES=/etc/conserver/invirt-genconfig.cf
dpkg -s "$PACKAGE" >/dev/null 2>/dev/null || exit 0
-. /lib/init/vars.sh
-. /lib/lsb/init-functions
-
-gen_config()
-{
- for i in /etc/conserver/invirt-genconfig.cf
- do mako-render $i.mako > $i
- done
-}
-
-case "$1" in
- start|reload|force-reload|restart)
- log_begin_msg "Reloading config for $PACKAGE"
- gen_config
- log_end_msg $?
- /etc/init.d/"$PARENTPACKAGE" "$1"
- ;;
- stop)
- /etc/init.d/"$PARENTPACKAGE" "$1"
- ;;
- *)
- log_success_msg "Usage: /etc/init.d/$PACKAGE {start|reload|force-reload|restart|stop}"
- ;;
-esac
+. /lib/init/config-init.sh
+config_init $1