Linux [FRODO] Resume Script to Logout Current User
#1
Hi,

I have upgraded from Eden to Frodo and am having trouble tracking down the information I need to update my script that logs out the active user when the system resumes. My old script issued a curl command to the XBMC http server to send the logout command.

My old script
Code:
#!/bin/sh

# This script uses curl. Install curl using the following command from your terminal apt-get install curl
case "$1" in
    resume)
        curl "http://xbmc:[email protected]:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=System.Logoff"
    ;;
esac

I was reading and noticed that the old method of sending commands to the XBMC device has been switched to a JSON RPC structure but I am having trouble tracking down how to achieve this.

Any help would greatly be appreciated.
Reply
#2
Hey everyone.

A little persistence pays off once again. I have found a method for logging off the active profile before the system is suspended.

I was able to issue the logoff command using the xbmc-send command.

Code:
sudo apt-get install xbmc-eventclients-xbmc-send

I then created a script file to be executed when the system is being suspended.

Code:
sudo nano /etc/pm/sleep.d/00_logoff

The script checks to make sure a suspend operation is being performed and issues the System.LogOff command.

Code:
!/bin/sh
[ "$1" = "suspend" ] && xbmc-send --action="System.LogOff"

exit 0


Ensure the script has the execution bit set.

Code:
sudo chmod +x /etc/pm/sleep.d/00_Logoff

You might want to update the script to also check for a hibernation operation (if you have it enabled).

My quick tests thus far show the script executing properly and when my system resumes from a suspend I am greeted with the Login screen.

I have tested this with Frodo RC3 XBMCUbuntu running on my AsRock ION HTPC.
Reply

Logout Mark Read Team Forum Stats Members Help
[FRODO] Resume Script to Logout Current User0