#!/bin/bash # # stop-kde-pim # # Stop akonadi and nepomukserver. # Required before an update of the organiser.ics file will be picked up. # # Volker Kuhlmann # 3 Feb 2013 # 28 Oct 2014 Shut down akonadi mysql. # 11 Nov 2014 Wait for akonadi to quit before shutting down mysql. # Improve script output. # 13 Nov 2014 While waiting for akonadi to exit, check mysql is still # running. # ## akonadi ( set -x akonadictl stop ) ## nepomuk echo "" ( set -x #qdbus org.kde.NepomukServer /nepomukserver quit qdbus org.kde.NepomukServer /nepomukserver org.kde.NepomukServer.quit ) #Try?: #qdbus org.kde.nepomukcontroller /MainApplication org.kde.KApplication.quit # Restarting nepomuk # https://bugs.kde.org/show_bug.cgi?id=259949 # https://bugs.kde.org/attachment.cgi?id=77344 # ##Check status of ANF #FeederStatus=`qdbus org.freedesktop.Akonadi.Agent.akonadi_nepomuk_feeder / org.freedesktop.Akonadi.Agent.Status.isOnline` ##If status still false #if [ "$FeederStatus" = "false" ];then # #Restart ANF # qdbus org.freedesktop.Akonadi.Control /AgentManager org.freedesktop.Akonadi.AgentManager.restartAgentInstance "akonadi_nepomuk_feeder" #fi ## mysql socket="/home/$USER/.local/share/akonadi/socket-$HOSTNAME/mysql.socket" echo "" if [ -e "$socket" ]; then echo -n "Waiting for akonadi to quit " while [ -e "$socket" ]; do { akonadictl status 2>&1 | grep -i "server:.*running" >/dev/null ; } \ || break echo -n "." sleep 1 done if [ -e "$socket" ]; then echo " done." ( set -x mysqladmin --socket="$socket" shutdown ) else echo " mysql exited already." fi else echo "* Akonadi mysql is not running." fi ## dbus #Execute the output of dbus-launch --auto-syntax in the shell. #start-dbus is aliased to eval `dbus-launch --auto-syntax`