Changed architecture from any to all
[hostuuid-debian.git] / debian / postinst
blob4c4b0028174a2bc09662f47a41fa8d11cb4e86aa
1 #!/bin/sh
2 set -e
3 set -x
5 action="$1"
6 oldversion="$2"
7 uuid_file='/etc/hostuuid'
8 create_uuid=''
10 export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
12 . /usr/share/debconf/confmodule
15 test_uuid_file() {
16 hostuuid --quiet --nostdin
19 test_uuid() {
20 echo -n $RET | hostuuid --quiet
24 if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then
25 if test_uuid_file; then
26 exit 0
27 else
28 # this is set to high as _if_ someone installs this package, the
29 # question is vital
30 db_input high hostuuid/enter_uuid || true
31 db_go
32 db_get hostuuid/enter_uuid
33 # if $RET is empty, generate a UUID
34 if [ -z "$RET" ]; then
35 echo $RET
36 # hostuuid --create --quiet --nostdin
37 hostuuid --create --nostdin
38 else
39 if test_uuid; then
40 # hostuuid --create --quiet --nostdin --input $RET
41 hostuuid --create --nostdin --input $RET
42 exit 0
43 else
44 db_fset hostuuid/faulty_uuid seen false
45 db_input critical hostuuid/faulty_uuid || true
46 db_go
52 exit 0
54 #DEBHELPER#