#!/bin/bash



function WakeOnLan()
{
    LogIt $ThisDev
    shuf -i 0-5|head -1|xargs sleep # To Protect electrical grid
    curl -sd 'pw=1' http://Energenie_LANpower-a/login.html >/dev/null
    curl -sd "cte4=1" http://Energenie_LANpower-a/status.html >/dev/null
}

function ShutDown()
{
    SleepOnLan
}    

function SleepOnLan()
{
    LogIt $ThisDev
    curl -sd 'pw=1' http://Energenie_LANpower-a/login.html >/dev/null
    curl -sd "cte4=0" http://Energenie_LANpower-a/status.html >/dev/null
}

