Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8401319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:46:32+00:00 2026-06-09T21:46:32+00:00

I’m trying to get my NAS server to wake from an S3 sleep state

  • 0

I’m trying to get my NAS server to wake from an S3 sleep state when the NAS is accessed by a user. I want to do this to increase the longevity of the server, and also to limit its power usage. I’ve seen people asking for similar advice but none that I found provide a robust solution, most threads just ended unanswered.

So to just detail my problem quickly:
At my home I have a custom built, from an old PC, NAS server, running Ubuntu server, which stores media and documents mainly. This server is currently set to sleep after a predefined inactive period. Currently the NAS can be brought out of the S3 state with a WOL magic packet. What I would like to achieve is that this magic packet is automatically sent to the server when a user accesses one of the shares from their PC. The users are primarily running windows 7. I’m not sure if this is entirely prevalent but I have a Linksys WRT54G running DD-WRT as my home router/DHCP/DNS.

During my research I came across many articles which just automatically woke the server on a timed loop, no real intelligence. The article given below seems to do what I want:

http://wdtvhd.com/index.php?showtopic=7908

A script is given which attempts to address this problem by using the DD-WRT router to send the wake-on-lan packets when a query is made. This seems like a good way to go about this, however I could not get the script given in the link to operate correctly.

I think that covers most aspects of my problem. Any assistance will be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:46:34+00:00Added an answer on June 9, 2026 at 9:46 pm

    Just thought I would post my eventual solution to the above mentioned problem. To solve the problem I wrote a custom script which runs on my dd-wrt router on a timed cron job. When this script runs it access the file

    \proc\net\arp
    

    Within in that file is stored a record of all currently leased IP address and the corresponding mac addresses. Thus my script compared the mac addresses stored within that file to a predefined list of mac address of PCs on my home network. The list is comprised only of the PCs I would like to be able to access the NAS server. If one of the PCs is found to have an active lease the router then sends the wake-on-lan magic packet. Which then wakes the server. At that point I thought I had achieved my goal, as the server switched on with any of the PCs on the network, and the wait was not too long. However, after completing this I found that my timed sleep for the server would initiate every 30 min or so and sleep the server only to be woken again a couples of seconds later.

    So to solve that issue I just added another condition to my conditional statement that would sleep the server if none of the required PC had an active lease. To do this I used SSH and the built in dropbear ssh functionality of DD-WRT to sleep the server. Below is the script

    #!/bin/ash
    
    NAS="MA:CA:DD:RE:SS:00"
    
    PC="MA:CA:DD:RE:SS:00"
    
    varP='grep -o $PC /proc/net/arp'
    
    while true
    do
        echo 'Entered Loop'
        if ping -c 1 IPADDRESSOFNAS > /dev/null; then
                echo 'NAS is Already ON'
    
        if [[ "$varP" != "MA:CA:DD:RE:SS:00" ]]; then
                        echo 'All Hosts Offline'
                        echo IPADDRESSOFNAS  ssh-rsa NASPUPLICKEY
                        #HOME=/temp/root/
                        DROPBEAR_PASSWORD='NASPASSWORD' ssh root@IPADDRESSOFNAS pm-suspend &
                fi
                exit
        fi
    
        if [[ "$varP" == "MA:CA:DD:RE:SS:00" ]]; then
                echo 'waking from lan'
                /usr/sbin/wol -i BROADCASTADDRESSOFNETORK -p 9 MA:CA:DD:RE:SS:00
                /usr/sbin/wol -i BROADCASTADDRESSOFNETORK  -p 9 MA:CA:DD:RE:SS:00
                exit
        fi
        exit
    done
    

    DISCLAMER: The code is supplied as is. I am aware it is not pretty nor the best solution possible. But it works for me and thats all I really need.

    Hope someone finds this useful!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.