~ahasenack/landscape-client/landscape-client-1.5.5-0ubuntu0.9.04.0

« back to all changes in this revision

Viewing changes to debian/config

  • Committer: Bazaar Package Importer
  • Author(s): Rick Clark
  • Date: 2008-09-08 16:35:57 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080908163557-l3ixzj5dxz37wnw2
Tags: 1.0.18-0ubuntu1
New upstream release 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
PACKAGE=landscape-client
 
4
 
 
5
CONFIGFILE=/etc/landscape/client.conf
 
6
set -e
 
7
. /usr/share/debconf/confmodule
 
8
 
 
9
# This function also exists in the postinst, please keep them in sync
 
10
get_var_from_file() {
 
11
        var="$1"
 
12
        file="$2"
 
13
        val=$(grep "^$var\s*=\s*" "$file" 2>/dev/null | tail -n1 | sed "s/^.*=\s*//")
 
14
        echo "$val"
 
15
}
 
16
 
 
17
# Load config file, if it exists.
 
18
if [ -e $CONFIGFILE ]; then
 
19
        # Config file is "ini" type, not shell, so we cannot source it
 
20
        COMPUTER_TITLE=$(get_var_from_file "computer_title" "$CONFIGFILE")
 
21
        ACCOUNT_NAME=$(get_var_from_file "account_name" "$CONFIGFILE")
 
22
        REGISTRATION_PASSWORD=$(get_var_from_file "registration_password" "$CONFIGFILE")
 
23
 
 
24
        # Store values from config file into
 
25
        # debconf db.
 
26
 
 
27
        db_set $PACKAGE/computer_title $COMPUTER_TITLE
 
28
        db_set $PACKAGE/account_name $ACCOUNT_NAME
 
29
        db_set $PACKAGE/registration_password $REGISTRATION_PASSWORD
 
30
 
 
31
fi
 
32
 
 
33
# Ask questions.
 
34
db_input medium $PACKAGE/sysinfo || true
 
35
db_input medium $PACKAGE/computer_title || true
 
36
db_input medium $PACKAGE/account_name || true
 
37
db_input medium $PACKAGE/registration_password || true
 
38
db_go