My NAS powers off every-night to save electricity thanks to a little script I created (see:
Advanced Shutdown Script - Powersaving).
But now every-morning, before I power on my desktop I need to boot up my NAS 1st
, and I am lazy, so the energy exerted to push the power button on my NAS box can be better used else where
So I created a little script that will wake up my NAS box and mount the share(s):
Code:
#!/bin/sh
###
# 2/3/09
# wake-NAS.sh
# Wake-On-Lan wake NAS Script
###
echo "Begin: $(date)" >> /home/user/scripts/wake-NAS.log
wakeonlan AA:BB:CC:DD:EE:FF >> /home/user/scripts/wake-NAS.log
sleep 5m
mount -a >> /home/user/scripts/wake-NAS.log
echo "End : $(date)" >> /home/user/scripts/wake-NAS.log
I am using Ubuntu,
So I put this script in /etc/init.d/ and ran 'update-rc.d wake-NAS.sh defaults' and rebooted, and it worked
However, there are two problems:
- It caused my bootup time to be +5minutes, due to the line "sleep 5m", I figured it would just run the script in the background on bootup and not holdup the boot, but that's not the case...
Is there a way to get this to run in the background so it doesn't hold up my bootup times?
Or maybe I could make the "mount -a" a separate script that runs after the machine is fully booted (i.e. in Ubuntu I could use System>Preferences>Sessions).
- It runs at shutdown as well, which is pointless, I don't want to wake my NAS when I am shutting down, nore do I want to mount my shares (mount -a)
Any idea's?
If anyone knows of a better way of going about this,
I am all ears