#!/bin/bash

PACKAGE=sipb-xen-remctl-auto

. /lib/lsb/init-functions

gen_config()
{
    echo "host/$(invirt-getconf remote.hostname)@$(invirt-getconf authn.0.realm)" \
        > /etc/remctl/acl/remote
}

case "$1" in
  start|reload|force-reload|restart)
    log_begin_msg "Reloading config for $PACKAGE"
    gen_config
    log_end_msg $?
    ;;
  stop)
    ;;
  *)
    log_success_msg "Usage: /etc/init.d/$PACKAGE {start|reload|force-reload|restart|stop}"
    ;;
esac
