Creating a script for asking to shutdown

H4MZ4

Member
I've seen various settings about automation of shutting down the E2 box after things like a ABM scan, but I'm trying to make something specific for my needs.

The problem is I'm more of a C# + VS person so I've got no idea on what to do on Linux systems.


Overall this is what I'm trying to do.

1. Create a .sh script so I can easily run it at a set time via CronManager
2. If the Box is fully on, popup asking to fully shutdown or not (with the option of yes and no)
3. If the Box is in standby, automatically fully shut it down


No idea where to start, but I'm gonna need something like (in basic non existent code language)

Code:
    if box = on
    {show.message = "Shutdown Box?"}
 

    else
    fullyshutdownbox()
 
Why not set a power timer? Menu, Timers, Power Timer not sure about adding else and if though
Ah didn't see that menu, although it kinda matches what I need but doesn't really have the feature of asking to shutdown if the box is currently on.

I've found a command for deep shutdown, so this could be used for if the popup result is yes:

Code:
wget -O /dev/null -q http://127.0.0.1/web/powerstate?newstate=0
 
Back
Top