mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 16:31:13 +00:00
83441522a2
This uses "hdparm" (if present) to get the harddisk into low power mode on NAS set-ups. Cc: Adrian Schmutzler <mail@adrianschmutzler.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
15 lines
269 B
Plaintext
15 lines
269 B
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
# Spin down drives after one minute if inactive
|
|
|
|
if [ ! -n "$(command -v hdparm)" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
DISKS=$(find /dev/sd[a-z] 2>/dev/null)
|
|
for DISK in $DISKS
|
|
do
|
|
if [ -b $DISK ] ; then
|
|
hdparm -S 12 $DISK > /dev/null
|
|
fi
|
|
done
|