Jump to content

disable script between certain hours


MvL

Recommended Posts

Hi,

 

I used this script (from the wiki) to put my unRAID server to sleep.

 

#!/bin/bash
drives="/dev/sda /dev/sdb"
timeout=5
count=5
while [ 1 ]
do
hdparm -C $drives | grep -q active
if [ $? -eq 1 ]
then
  count=$[$count-1]
else
  count=$timeout
fi
if [ $count -le 0 ]
then
  # Do pre-sleep activities
  sleep 5
  # Go to sleep
  echo 3 > /proc/acpi/sleep
  # Do post-sleep activities
  # Force NIC into gigabit mode
  # (might be needed forgets about gigabit when it wakes up)
  ethtool -s eth0 speed 1000
  # Force a DHCP renewal (shouldn't be used for static-ip boxes)
  /sbin/dhcpcd -n
  sleep 5
count=$timeout
fi
# Wait a minute
echo COUNT $count
sleep 60
done

 

is it possible to disable this script at certain hours? So the unRAID server stays awake between 6.00 -10.00pm.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...