How to automate "wake over lan" from a linux client

  • Hi to all !


    I'm about to replace my Windows Homeserver and am looking to achieve the same level of comfort as before with my Windows Machines.


    Therefore I need a simple way to wake up my OMV NAS via LAN when one of my notebooks is connected to my Home-LAN via WiFi and ready to issue the wol command.
    My clients are Ubuntu based systems: Linux Mint 17 and Peppermin OS.


    1) What is the best way of sending the wol command / Magic Packet without user interaction.
    2) Where do I issue the wol command.
    3) How do I check for WiFi connection prior to issuing the wol command.
    4) Does anyone already have such a script / solved my problem ? ?(


    Thanx in advance!

    • Offizieller Beitrag

    On linux, install the etherwake package and then issue the following command from the command line (substitute MACADDRESS for your server's mac address): etherwake -b MACADDRESS

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Here is one I use for my office. You could tailor it for your needs. The etherwake package is used in conjunction with this.


  • Thanx for your replies, but I'm looking for an automatic wake up, as soon as my laptop has finished booting and is connected to LAN via wifi.
    Do you happen to have a script for that? Or an idea of where to start looking?

    • Offizieller Beitrag

    Thanx for your replies, but I'm looking for an automatic wake up, as soon as my laptop has finished booting and is connected to LAN via wifi.
    Do you happen to have a script for that? Or an idea of where to start looking?


    You can put your command etherwake at /etc/rc.local with some sleep timer so that it waits for the network. I personally use the a cron command in my router (7AM) and smartphone app for manual.

  • Thanx for your replies !


    I will start with an etherwake call from within /etc/rc.local and see how far I get. Then I will include a network check into my script prior to the etherwake call. But this will require some more reading and understanding on my side :rolleyes: .

  • you can do something like this:

    Bash
    while true; do ping -c1 www.google.com > /dev/null && break; done
    etherwake MACADRESS


    this will wait, until ping to google is successful and etherwake your client

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!