source: trunk/packages/xvm-iscsi-config/debian/xvm-iscsi-config.postinst @ 1503

Last change on this file since 1503 was 1496, checked in by broder, 16 years ago

Create xvm-iscsi-config package

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/sh
2# postinst script for xvm-iscsi-config
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# Source debconf library
9. /usr/share/debconf/confmodule
10
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>
15#          <new-version>
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
22
23
24case "$1" in
25    configure)
26        db_get xvm-iscsi-config/address
27        ADDRESS="$RET"
28        db_get xvm-iscsi-config/username
29        USERNAME="$RET"
30        db_get xvm-iscsi-config/password
31        PASSWORD="$RET"
32       
33        cat >/etc/invirt/conf.d/iscsi <<EOF
34iscsi:
35 address: $ADDRESS
36 username: $USERNAME
37 password: $PASSWORD
38EOF
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
42    ;;
43
44    abort-upgrade|abort-remove|abort-deconfigure)
45    ;;
46
47    *)
48        echo "postinst called with unknown argument \`$1'" >&2
49        exit 1
50    ;;
51esac
52
53# dh_installdeb will replace this with shell code automatically
54# generated by other debhelper scripts.
55
56#DEBHELPER#
57
58exit 0
Note: See TracBrowser for help on using the repository browser.