Release version 4.0.7.
[carnet-upgrade.git] / src / scripts / debconf_priority
1 #!/bin/sh
2
3 # Load debconf stuff
4 . /usr/share/debconf/confmodule
5
6 # setiraj debconf na high i spremi stari
7 debconf_priority_preupgrade () {
8   local old_debconf
9
10   db_get debconf/priority || true
11   old_debconf="$RET"
12
13   if [ -n "$old_debconf" ]; then
14     db_set carnet-upgrade/debconf-priority "$old_debconf"
15   fi
16
17   db_set debconf/priority high
18   db_go || true
19 }
20
21
22 # vrati debconf na staru vrijednost
23 debconf_priority_postupgrade () {
24   local new_debconf
25
26   db_get carnet-upgrade/debconf-priority || true
27   new_debconf="$RET"
28
29   if [ -n "$new_debconf" ]; then
30     db_set debconf/priority "$new_debconf"
31     db_set carnet-upgrade/debconf-priority ""
32   fi
33
34   db_go || true
35 }
36
37 # checkiraj
38 debconf_priority_check () {
39   db_get carnet-upgrade/debconf-priority || true
40   debconf="$RET"
41
42   if [ -n "$debconf" ]; then
43     exit 0
44   else
45     exit 1
46   fi
47 }
48
49 case "$1" in
50 set)    debconf_priority_preupgrade
51         ;;
52 reset)  debconf_priority_postupgrade
53         ;;
54 check)  debconf_priority_check
55         ;;
56 *)      echo "Usage: $0 (set|reset|check)"
57         exit 1 
58         ;;
59 esac
60 exit 0
61