* added back in the INIT INFO headers that were accidentally removed in previous rev
[invirt/packages/invirt-remote.git] / debian / sipb-xen-remctl-auto.init
1 #!/bin/bash
2 ### BEGIN INIT INFO
3 # Provides:          sipb-xen-remctl-auto
4 # Required-Start:    $local_fs $remote_fs
5 # Required-Stop:     $local_fs $remote_fs
6 # Default-Start:     2 3 4 5
7 # Default-Stop:      0 1 6
8 # Short-Description: conserver config from invirt config for invirt host
9 # Description:
10 ### END INIT INFO 
11
12 PACKAGE=sipb-xen-remctl-auto
13
14 . /lib/lsb/init-functions
15
16 gen_config()
17 {
18     echo "host/$(invirt-getconf remote.hostname)@$(invirt-getconf authn.0.realm)" \
19         > /etc/remctl/acl/remote
20 }
21
22 case "$1" in
23   start|reload|force-reload|restart)
24     log_begin_msg "Reloading config for $PACKAGE"
25     gen_config
26     log_end_msg $?
27     ;;
28   stop)
29     ;;
30   *)
31     log_success_msg "Usage: /etc/init.d/$PACKAGE {start|reload|force-reload|restart|stop}"
32     ;;
33 esac