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 "Checking for log folder ..."
33 [[ ! -d /var/log/vicar ]] && mkdir /var/log/vicar
35 echo "Checking for log file ..."
36 [[ ! -e /var/log/vicar/vicar.log ]] && touch /var/log/vicar/vicar.log && chown -R user:users /var/log/vicar
38 echo "Starting Vicar daemon ..."
39 #[[ -x /opt/vicar/bin/vicar-daemon ]] && su - user -c "exec /opt/vicar/bin/vicar-daemon& >/dev/null"
41 echo "Starting Vicar-Telepathy ..."
42 #[[ -x /opt/vicar/bin/vicar-telepathy ]] && su - user -c "exec /opt/vicar/bin/vicar-telepathy& >/dev/null"
44 echo "Creating Vicar Telepathy account ..."
45 #[[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/vicar-utils INSTALL"
47 echo "Updating permissions on Vicar DB file ..."
48 #[[ -e /home/user/vicar.db.sqlite ]] && chown user:users /home/user/vicar.db.sqlite
50 echo "Creating Vicar Profiles database ..."
51 #[[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/vicar-utils CREATEDB"
55 abort-upgrade|abort-remove|abort-deconfigure)
59 echo "postinst called with unknown argument \`$1'" >&2
64 # dh_installdeb will replace this with shell code automatically
65 # generated by other debhelper scripts.