[REQUEST] WOL Wake on Lan on Movie selection

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
kricker Offline
Team-XBMC QA Specialist
Posts: 3,304
Joined: Apr 2004
Reputation: 16
Location: Knoxville, TN
Post: #11
I doubt I can do this from my router, but at the risk of thread jacking, can you elaborate a bit more on that.

Read this before using these builds.
XBMC win32 SVN builds
Changelog
find quote
dizzyikea Offline
Senior Member
Posts: 170
Joined: Jun 2011
Reputation: 0
Location: Grimsby
Post: #12
#!/bin/sh
INTERVAL=5
NUMP=3
OLD=""
PORT=8080
WOLPORT=9
TARGET=x.x.x.ip
BROADCAST=x.x.x.255
MAC=removed
WOL=/usr/sbin/wol
LOGFILE="/tmp/www/wol.html"

echo "<meta http-equiv=\"refresh\" content=\"10\">" > $LOGFILE
echo "AUTO WOL Script started at" `date` "<br>" >> $LOGFILE

while sleep $INTERVAL;do
NEW=`dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print }' | tail -1`
SRC=`dmesg | awk -F'[=| ]' '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print $7}' | tail -1`
LINE=`dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/'`

if [ "$NEW" != "" -a "$NEW" != "$OLD" ]; then
if ping -qc $NUMP $TARGET >/dev/null; then
echo "NOWAKE $TARGET was accessed by $SRC and is already alive at" `date` "<br>">> $LOGFILE
else
echo "WAKE $SRC causes wake on lan at" `date` "<br>">> $LOGFILE
$WOL -i $BROADCAST -p $WOLPORT $MAC >> $LOGFILE
echo "<br>" >> $LOGFILE
sleep 5
fi
OLD=$NEW
fi
done

Server Ubuntu 11.04 (Gnome2) Sickbeard+Sabnzbd+mysql+VPN+xbmc (broken)
New Solar powered server underway folow +Darren Finlay-Smith
Home Clients ATV2, XBMCLive, Ubuntu 11.04 (Unity) XBMC Moblie Clients Iphone, Ubuntu 11.04 (Unity) XBMC, Win7 XBMC all eden beta 1


[Image: widget]
find quote
pko66 Offline
Senior Member
Posts: 189
Joined: Dec 2006
Reputation: 0
Post: #13
One possible solution would be if XBMC had the option of running a script before opening a source of data.

For example, when you add a new video/audio source, one "advanced" option would be "run this script before accessing". then, some python scripts (made by other people, not necessarily by teamXBMC) would take care of whatever is needed

- If the source is in a remote server that needs WOL, a specified WOL script will wake up the remote server, based in a parameter (the source name)
- If the source is in a removable drive it will ask for the correct media to be inserted, based on a parameter (the media file name)
- If the source needs some action taken before is active (for example, to turn on an external USB drive), the script will ask the user to do the required action and then wait until the media is available
- etc...

Basically, XBMC will just provide the means and then it will be up to the addon programmer's brain to work out what could be done and how it could be implemented.

A further refinement could be to run another script at the end of the media reproduction or at the end of the XBMC session if the source was in any moment activated (for example, to turn off the media server that was WOL'ed before)
find quote
Post Reply