~g7/boxeelive/defaults

« back to all changes in this revision

Viewing changes to debian/prerm

  • Committer: g7
  • Date: 2011-02-14 15:41:00 UTC
  • Revision ID: morarossa@gmail.com-20110214154100-v8ajv7ueefze8mh9
Disabled postist and prerm; instead using conffiles file, more cool :)
Minor things to rules and control;
Distribution in changelog is "maverick" and not "unstable".

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# postrm script for #PACKAGE#
3
 
#
4
 
# see: dh_installdeb(1)
5
 
 
6
 
set -e
7
 
 
8
 
# summary of how this script can be called:
9
 
#        * <postrm> `remove'
10
 
#        * <postrm> `purge'
11
 
#        * <old-postrm> `upgrade' <new-version>
12
 
#        * <new-postrm> `failed-upgrade' <old-version>
13
 
#        * <new-postrm> `abort-install'
14
 
#        * <new-postrm> `abort-install' <old-version>
15
 
#        * <new-postrm> `abort-upgrade' <old-version>
16
 
#        * <disappearer's-postrm> `disappear' <overwriter>
17
 
#          <overwriter-version>
18
 
# for details, see http://www.debian.org/doc/debian-policy/ or
19
 
# the debian-policy package
20
 
 
21
 
mtdaapd() {
22
 
        echo -n "* BoxeeLive: Restoring mt-daapd configuration... "
23
 
        md51="`md5sum /usr/share/boxeelive/mt-daapd.conf | cut -d \" \" -f1`"
24
 
        md52="`md5sum /etc/mt-daapd.conf | cut -d \" \" -f1`"
25
 
        if [ "$md51" = "$md52" ]; then
26
 
                # config not touched by user; we can safely restore the older.
27
 
                rm /etc/mt-daapd.conf
28
 
                mv /etc/mt-daapd.conf.boxeelivebackup /etc/mt-daapd.conf
29
 
                [ "$?" != "0" ] && echo "Failed."
30
 
        else
31
 
                # config changed by someone. Leave it untouched.
32
 
                echo "Modified by user; leaved untouched."
33
 
        fi
34
 
        
35
 
        echo "Done."
36
 
        invoke-rc.d mt-daapd restart || echo "Failed to restart mt-daapd server. Changes will take effect on the next boot."
37
 
}
38
 
 
39
 
modprobes() {
40
 
        echo -n "* BoxeeLive: Restoring modprobe.d alsa-base configuration... "
41
 
        md51="`md5sum /usr/share/boxeelive/alsa-base.conf | cut -d \" \" -f1`"
42
 
        md52="`md5sum /etc/modprobe.d/alsa-base.conf | cut -d \" \" -f1`"
43
 
        if [ "$md51" = "$md52" ]; then
44
 
                # config not touched by user; we can safely restore the older.
45
 
                rm /etc/modprobe.d/alsa-base.conf
46
 
                mv /etc/modprobe.d/alsa-base.conf.boxeelivebackup /etc/modprobe.d/alsa-base.conf
47
 
                [ "$?" != "0" ] && echo "Failed."
48
 
        else
49
 
                # config changed by someone. Leave it untouched.
50
 
                echo "Modified by user; leaved untouched."
51
 
        fi
52
 
        
53
 
        echo "Done."
54
 
}
55
 
 
56
 
rclocal() {
57
 
        echo -n "* BoxeeLive: Restoring rc.local... "
58
 
        md51="`md5sum /usr/share/boxeelive/rc.local | cut -d \" \" -f1`"
59
 
        md52="`md5sum /etc/rc.local | cut -d \" \" -f1`"
60
 
        if [ "$md51" = "$md52" ]; then
61
 
                # config not touched by user; we can safely restore the older.
62
 
                rm /etc/rc.local
63
 
                mv /etc/rc.local.boxeelivebackup /etc/rc.local
64
 
                [ "$?" != "0" ] && echo "Failed."
65
 
        else
66
 
                # config changed by someone. Leave it untouched.
67
 
                echo "Modified by user; leaved untouched."
68
 
        fi
69
 
        
70
 
        echo "Done."
71
 
}
72
 
 
73
 
bluetooth() {
74
 
        echo -n "* BoxeeLive: Restoring bluetooth configuration... "
75
 
        md51="`md5sum /usr/share/boxeelive/input.conf | cut -d \" \" -f1`"
76
 
        md52="`md5sum /etc/bluetooth/input.conf | cut -d \" \" -f1`"
77
 
        if [ "$md51" = "$md52" ]; then
78
 
                # config not touched by user; we can safely restore the older.
79
 
                rm /etc/bluetooth/input.conf
80
 
                mv /etc/bluetooth/input.conf.boxeelivebackup /etc/bluetooth/input.conf
81
 
                [ "$?" != "0" ] && echo "Failed."
82
 
        else
83
 
                # config changed by someone. Leave it untouched.
84
 
                echo "Modified by user; leaved untouched."
85
 
        fi
86
 
        
87
 
        echo "Done."
88
 
}
89
 
 
90
 
transmission() {
91
 
        echo -n "* BoxeeLive: Restoring transmission-daemon configuration... "
92
 
        md51="`md5sum /usr/share/boxeelive/settings.json | cut -d \" \" -f1`"
93
 
        md52="`md5sum /etc/transmission-daemon/settings.json | cut -d \" \" -f1`"
94
 
        if [ "$md51" = "$md52" ]; then
95
 
                # config not touched by user; we can safely restore the older.
96
 
                rm /etc/transmission-daemon/settings.json
97
 
                mv /etc/transmission-daemon/settings.json.boxeelivebackup /etc/transmission-daemon/settings.json
98
 
                [ "$?" != "0" ] && echo "Failed."
99
 
        else
100
 
                # config changed by someone. Leave it untouched.
101
 
                echo "Modified by user; leaved untouched."
102
 
        fi
103
 
        
104
 
        echo "Done."
105
 
}
106
 
 
107
 
sabnzdbplus() {
108
 
        echo -n "* BoxeeLive: Restoring sabnzdbplus configuration... "
109
 
        md51="`md5sum /usr/share/boxeelive/sabnzdbplus | cut -d \" \" -f1`"
110
 
        md52="`md5sum /etc/default/sabnzbdplus | cut -d \" \" -f1`"
111
 
        if [ "$md51" = "$md52" ]; then
112
 
                # config not touched by user; we can safely restore the older.
113
 
                rm /etc/default/sabnzbdplus
114
 
                mv /etc/default/sabnzbdplus.boxeelivebackup /etc/default/sabnzbdplus
115
 
                [ "$?" != "0" ] && echo "Failed."
116
 
        else
117
 
                # config changed by someone. Leave it untouched.
118
 
                echo "Modified by user; leaved untouched."
119
 
        fi
120
 
        
121
 
        echo "Done."
122
 
}
123
 
 
124
 
case "$1" in
125
 
    purge|remove|failed-upgrade|abort-install|abort-upgrade|disappear)
126
 
        mtdaapd
127
 
        modprobes
128
 
        rclocal
129
 
        bluetooth
130
 
        transmission
131
 
        sabnzdbplus
132
 
    ;;
133
 
 
134
 
    upgrade)
135
 
    echo "* Package upgrade; skipping prerm.";;
136
 
 
137
 
    *)
138
 
        echo "postrm called with unknown argument \`$1'" >&2
139
 
        exit 1
140
 
    ;;
141
 
esac
142
 
 
143
 
# dh_installdeb will replace this with shell code automatically
144
 
# generated by other debhelper scripts.
145
 
 
146
 
#DEBHELPER#
147
 
 
148
 
exit 0