Release 0.5-1 contains (Muti-profile support, Contacts Integration)
[vicar] / debian / postinst
old mode 100644 (file)
new mode 100755 (executable)
index 56eb403..0b39348
@@ -23,9 +23,39 @@ case "$1" in
 
        # Kill any running instances of the daemon (only used on Linux based systems)
        killall -q vicar-daemon || true
+       killall -q vicar-telepathy || true
+
+        echo "Starting Vicar daemon ..."
+        [[ -x /opt/vicar/vicar-daemon ]] && su - user -c "exec /opt/vicar/vicar-daemon& >/dev/null"
+
+        echo "Starting Vicar-Telepathy ..."
+        [[ -x /opt/vicar/vicar-telepathy ]] && su - user -c "exec /opt/vicar/vicar-telepathy& >/dev/null"
+
+        echo "Removing Vicar launch script..."
+        [[ -x /etc/event.d/launch-vicar ]] && rm -f /etc/event.d/launch-vicar
+
+        echo "Deleting previous release configuration from GConf ..."
+        gconftool-2 --unset /apps/Maemo/vicar/routing_enabled
+        gconftool-2 --unset /apps/Maemo/vicar/calling_card_number
+        gconftool-2 --unset /apps/Maemo/vicar/dtmf_delay
+        gconftool-2 --unset /apps/Maemo/vicar/numbers_to_exclude
+        gconftool-2 --unset /apps/Maemo/vicar/dtmf_format
+        gconftool-2 --unset /apps/Maemo/vicar/dtmf_prefix
+        gconftool-2 --unset /apps/Maemo/vicar/dtmf_suffix
+
+        echo "Creating Vicar Telepathy account ..."
+        [[ -x /opt/vicar/vicar-utils ]] && su - user -c "exec /opt/vicar/vicar-utils INSTALL"
+
+        echo "Updating permissions on Vicar DB file ..."
+        [[ -e /home/user/vicar.db.sqlite ]] && chown user:users /home/user/vicar.db.sqlite
+
+        echo "Creating Vicar Profiles database ..."
+        [[ -x /opt/vicar/vicar-utils ]] && su - user -c "exec /opt/vicar/vicar-utils CREATEDB"
+
+       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.
+
+        Please launch VICaR to setup routing profiles." uint32:0 string:"OK"
 
-        echo "Sarting VICaR daemon ..."
-        [[ -x /opt/vicar/vicar-daemon ]] && exec /opt/vicar/vicar-daemon& >/dev/null
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)