~g7/boxeelive/defaults

« back to all changes in this revision

Viewing changes to debian/postinst

  • 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
 
# postinst script for #PACKAGE#
3
 
#
4
 
# see: dh_installdeb(1)
5
 
 
6
 
#set -e
7
 
 
8
 
# summary of how this script can be called:
9
 
#        * <postinst> `configure' <most-recently-configured-version>
10
 
#        * <old-postinst> `abort-upgrade' <new version>
11
 
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12
 
#          <new-version>
13
 
#        * <postinst> `abort-remove'
14
 
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15
 
#          <failed-install-package> <version> `removing'
16
 
#          <conflicting-package> <version>
17
 
# for details, see http://www.debian.org/doc/debian-policy/ or
18
 
# the debian-policy package
19
 
 
20
 
mtdaapd() {
21
 
        echo -n "* BoxeeLive: Install mt-daapd configuration... "
22
 
        # Backup the old config
23
 
        mv /etc/mt-daapd.conf /etc/mt-daapd.conf.boxeelivebackup
24
 
        # Copy the new one
25
 
        cp /usr/share/boxeelive/mt-daapd.conf /etc/mt-daapd.conf
26
 
        if [ "$?" != "0" ]; then
27
 
                echo "Failed."
28
 
                echo "W: Failed to change mt-daapd Configuration."
29
 
                return 0
30
 
        fi
31
 
        
32
 
        echo "Done."
33
 
        invoke-rc.d mt-daapd restart || echo "Failed to restart mt-daapd server. Changes will take effect on the next boot."
34
 
}
35
 
 
36
 
modprobes() {
37
 
        # WARNING: Not the best thing to do, the replace of a modprobe.d file...
38
 
        echo -n "* BoxeeLive: Install modprobe.d alsa-base configuration... "
39
 
        # Backup the old config
40
 
        mv /etc/modprobe.d/alsa-base.conf /etc/modprobe.d/alsa-base.conf.boxeelivebackup
41
 
        # Copy the new one
42
 
        cp /usr/share/boxeelive/alsa-base.conf /etc/modprobe.d/alsa-base.conf
43
 
        if [ "$?" != "0" ]; then
44
 
                echo "Failed."
45
 
                echo "W: Failed to change modprobe.d Configuration. WARNING: THE SYSTEM IS POTENTIALLY HARMED!"
46
 
                return 0
47
 
        fi
48
 
        
49
 
        echo "Done."
50
 
}
51
 
 
52
 
rclocal() {
53
 
        # WARNING: Not the best thing to do, but needed.
54
 
        echo -n "* BoxeeLive: Changing rc.local..."
55
 
        # Backup the old config
56
 
        mv /etc/rc.local /etc/rc.local.boxeelivebackup
57
 
        # Copy the new one
58
 
        cp /usr/share/boxeelive/rc.local /etc/rc.local
59
 
        if [ "$?" != "0" ]; then
60
 
                echo "Failed."
61
 
                echo "W: Failed to change rc.local."
62
 
                return 0
63
 
        fi
64
 
        
65
 
        echo "Done."
66
 
}
67
 
 
68
 
bluetooth() {
69
 
        echo -n "* BoxeeLive: Install bluetooth configuration... "
70
 
        # Backup the old config
71
 
        mv /etc/bluetooth/input.conf /etc/bluetooth/input.conf.boxeelivebackup
72
 
        # Copy the new one
73
 
        cp /usr/share/boxeelive/input.conf /etc/bluetooth/input.conf
74
 
        if [ "$?" != "0" ]; then
75
 
                echo "Failed."
76
 
                echo "W: Failed to change input.conf Configuration."
77
 
                return 0
78
 
        fi
79
 
        
80
 
        echo "Done."
81
 
        invoke-rc.d bluetooth restart || echo "Failed to restart bluetooth daemon. Changes will take effect on the next boot."
82
 
}
83
 
 
84
 
transmission() {
85
 
        echo -n "* BoxeeLive: Install transmission configuration... "
86
 
        # Backup the old config
87
 
        mv /etc/transmission-daemon/settings.json /etc/transmission-daemon/settings.json.boxeelivebackup
88
 
        # Copy the new one
89
 
        cp /usr/share/boxeelive/settings.json /etc/transmission-daemon/settings.json
90
 
        if [ "$?" != "0" ]; then
91
 
                echo "Failed."
92
 
                echo "W: Failed to change settings.json Configuration."
93
 
                return 0
94
 
        fi
95
 
        
96
 
        echo "Done."
97
 
        invoke-rc.d transmission-daemon reload || echo "Failed to reload transmission daemon. Changes will take effect on the next boot."
98
 
}
99
 
 
100
 
sabnzdbplus() {
101
 
        echo -n "* BoxeeLive: Install sabnzdbplus configuration... "
102
 
        # Backup the old config
103
 
        mv /etc/default/sabnzbdplus /etc/default/sabnzbdplus.boxeelivebackup
104
 
        # Copy the new one
105
 
        cp /usr/share/boxeelive/sabnzbdplus /etc/default/sabnzbdplus
106
 
        if [ "$?" != "0" ]; then
107
 
                echo "Failed."
108
 
                echo "W: Failed to change sabnzdbplus Configuration."
109
 
                return 0
110
 
        fi
111
 
        
112
 
        echo "Done."
113
 
        invoke-rc.d transmission-daemon restart || echo "Failed to restart sabnzdbplus daemon. Changes will take effect on the next boot."
114
 
}
115
 
 
116
 
case "$1" in
117
 
    configure)
118
 
        mtdaapd
119
 
        modprobes
120
 
        rclocal
121
 
        bluetooth
122
 
        transmission
123
 
        sabnzdbplus
124
 
        ;;
125
 
 
126
 
    abort-upgrade|abort-remove|abort-deconfigure)
127
 
    ;;
128
 
 
129
 
    *)
130
 
        echo "postinst called with unknown argument \`$1'" >&2
131
 
        exit 1
132
 
    ;;
133
 
esac
134
 
 
135
 
# dh_installdeb will replace this with shell code automatically
136
 
# generated by other debhelper scripts.
137
 
 
138
 
#DEBHELPER#
139
 
 
140
 
exit 0