2 # postinst script for xvm-iscsi-config
4 # see: dh_installdeb(1)
8 # Source debconf library
9 . /usr/share/debconf/confmodule
11 # summary of how this script can be called:
12 # * <postinst> `configure' <most-recently-configured-version>
13 # * <old-postinst> `abort-upgrade' <new version>
14 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
16 # * <postinst> `abort-remove'
17 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
18 # <failed-install-package> <version> `removing'
19 # <conflicting-package> <version>
20 # for details, see http://www.debian.org/doc/debian-policy/ or
21 # the debian-policy package
26 db_get xvm-iscsi-config/address
28 db_get xvm-iscsi-config/username
30 db_get xvm-iscsi-config/password
33 cat >/etc/invirt/conf.d/iscsi <<EOF
39 invoke-rc.d xvm-iscsi-config restart
40 invoke-rc.d open-iscsi restart
41 iscsiadm -m discovery -t st -p $(invirt-getconf iscsi.address):3260
44 abort-upgrade|abort-remove|abort-deconfigure)
48 echo "postinst called with unknown argument \`$1'" >&2
53 # dh_installdeb will replace this with shell code automatically
54 # generated by other debhelper scripts.