From 7374934e5a952d409bc24b03beb83999f344323d Mon Sep 17 00:00:00 2001 From: Greg Price Date: Wed, 30 Jul 2008 22:29:17 -0400 Subject: [PATCH] use invirt-getconf to generate config in sipb-xen-console svn path=/trunk/packages/sipb-xen-console/; revision=800 --- debian/changelog | 6 ++++++ debian/sipb-xen-console.init | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9a3b3b2..43e35dc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sipb-xen-console (7.6) unstable; urgency=low + + * Use invirt-getconf to generate config. + + -- Greg Price Wed, 30 Jul 2008 22:28:33 -0400 + sipb-xen-console (7.5) unstable; urgency=low * Generate config at start/reload from /etc/invirt/*. diff --git a/debian/sipb-xen-console.init b/debian/sipb-xen-console.init index 23d439d..9deced5 100755 --- a/debian/sipb-xen-console.init +++ b/debian/sipb-xen-console.init @@ -37,11 +37,15 @@ SCRIPTNAME=/etc/init.d/$NAME gen_config() { - perl -pe 's|^|#include /etc/conserver/conf.d/|' \ - /etc/conserver/invirt-hosts.cf - INVIRT_REALM="$(cat /etc/invirt/realm)" - perl -pe "s|^|host/|; s|\$|\@$INVIRT_REALM|" \ - /etc/remctl/acl/invirt-console + (for i in $(invirt-getconf --ls hosts); do + hostname=$(invirt-getconf hosts.$i.hostname) + echo "#include /etc/conserver/conf.d/$hostname" + done) >/etc/conserver/invirt-hosts.cf + realm=$(invirt-getconf authn.0.realm) + (for i in $(invirt-getconf --ls hosts); do + hostname=$(invirt-getconf hosts.$i.hostname) + echo "host/$hostname@$realm" + done) >/etc/remctl/acl/invirt-console } # -- 1.7.9.5