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 eval $(dbus-launch --sh-syntax)
25 export DBUS_SESSION_BUS_ADDRESS
26 export DBUS_SESSION_BUS_PID
28 # Kill any running instances of the daemon (only used on Linux based systems)
29 killall -q vicar-daemon || true
30 killall -q vicar-telepathy || true
32 echo "Starting Vicar daemon ..."
33 [[ -x /opt/vicar/vicar-daemon ]] && su - user -c "exec /opt/vicar/vicar-daemon& >/dev/null"
35 echo "Starting Vicar-Telepathy ..."
36 [[ -x /opt/vicar/vicar-telepathy ]] && su - user -c "exec /opt/vicar/vicar-telepathy& >/dev/null"
38 echo "Removing Vicar launch script..."
39 [[ -x /etc/event.d/launch-vicar ]] && rm -f /etc/event.d/launch-vicar
41 echo "Deleting previous release configuration from GConf ..."
42 gconftool-2 --unset /apps/Maemo/vicar/routing_enabled
43 gconftool-2 --unset /apps/Maemo/vicar/calling_card_number
44 gconftool-2 --unset /apps/Maemo/vicar/dtmf_delay
45 gconftool-2 --unset /apps/Maemo/vicar/numbers_to_exclude
46 gconftool-2 --unset /apps/Maemo/vicar/dtmf_format
47 gconftool-2 --unset /apps/Maemo/vicar/dtmf_prefix
48 gconftool-2 --unset /apps/Maemo/vicar/dtmf_suffix
50 echo "Creating Vicar Telepathy account ..."
51 [[ -x /opt/vicar/vicar-utils ]] && su - user -c "exec /opt/vicar/vicar-utils INSTALL"
53 echo "Updating permissions on Vicar DB file ..."
54 [[ -e /home/user/vicar.db.sqlite ]] && chown user:users /home/user/vicar.db.sqlite
56 echo "Creating Vicar Profiles database ..."
57 [[ -x /opt/vicar/vicar-utils ]] && su - user -c "exec /opt/vicar/vicar-utils CREATEDB"
59 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.
61 Please launch VICaR to setup routing profiles." uint32:0 string:"OK"
65 abort-upgrade|abort-remove|abort-deconfigure)
69 echo "postinst called with unknown argument \`$1'" >&2
74 # dh_installdeb will replace this with shell code automatically
75 # generated by other debhelper scripts.