#!/bin/sh
# postinst

if ! grep "\[supplementary\]" /home/user/.osso/call-ui.ini >/dev/null 2>&1;
#if file doesn't exist or doesn't contain the easter egg
then
 echo -e "[supplementary]\nssc=1" >> /home/user/.osso/call-ui.ini
 #maybe file didn't exist, so if we just created it, we should fix owner/perm
 chown user:users /home/user/.osso/call-ui.ini
 chmod 644 /home/user/.osso/call-ui.ini
fi

# dealing with previously 'uninstalled' situation
sed -i 's/ssc=0/ssc=1/' /home/user/.osso/call-ui.ini
run-standalone.sh dbus-send --type=method_call \
  --dest=org.freedesktop.Notifications /org/freedesktop/Notifications \
  org.freedesktop.Notifications.SystemNoteInfoprint \
  string:"restarting phone application"
killall -9 rtcom-call-ui
