2 # postinst script for vicar
4 # see: dh_installdeb(1)
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>
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
24 # Kill any running instances of the daemon (only used on Linux based systems)
25 killall -q vicar-daemon || true
26 killall -q vicar-telepathy || true
28 echo "Starting Vicar daemon ..."
29 [[ -x /opt/vicar/vicar-daemon ]] && su - user -c "exec /opt/vicar/vicar-daemon& >/dev/null"
31 echo "Starting Vicar-Telepathy ..."
32 [[ -x /opt/vicar/vicar-telepathy ]] && su - user -c "exec /opt/vicar/vicar-telepathy& >/dev/null"
34 echo "Removing Vicar launch script..."
35 [[ -x /etc/event.d/launch-vicar ]] && rm -f /etc/event.d/launch-vicar
37 echo "Deleting previous release configuration from GConf ..."
38 gconftool-2 --unset /apps/Maemo/vicar/routing_enabled
39 gconftool-2 --unset /apps/Maemo/vicar/calling_card_number
40 gconftool-2 --unset /apps/Maemo/vicar/dtmf_delay
41 gconftool-2 --unset /apps/Maemo/vicar/numbers_to_exclude
42 gconftool-2 --unset /apps/Maemo/vicar/dtmf_format
43 gconftool-2 --unset /apps/Maemo/vicar/dtmf_prefix
44 gconftool-2 --unset /apps/Maemo/vicar/dtmf_suffix
46 echo "Creating Vicar Telepathy account ..."
47 [[ -x /opt/vicar/vicar-utils ]] && su - user -c "exec /opt/vicar/vicar-utils INSTALL"
49 echo "Updating permissions on Vicar DB file ..."
50 [[ -e /home/user/vicar.db.sqlite ]] && chown user:users /home/user/vicar.db.sqlite
52 echo "Creating Vicar Profiles database ..."
53 [[ -x /opt/vicar/vicar-utils ]] && su - user -c "exec /opt/vicar/vicar-utils CREATEDB"
55 dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"Starting with this release, Multiple profiles can be created for routing calls via VICaR.
57 Please launch VICaR to setup routing profiles." uint32:0 string:"OK"
61 abort-upgrade|abort-remove|abort-deconfigure)
65 echo "postinst called with unknown argument \`$1'" >&2
70 # dh_installdeb will replace this with shell code automatically
71 # generated by other debhelper scripts.