Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org]
> On Behalf Of Linus Walleij
> Sent: Montag, 5. Juli 2021 00:01
> To: Sebastian Luft <sebastian.l...@gmail.com>; Hans Ulli Kroll
> <ulli.kr...@googlemail.com>; Hauke Mehrtens <ha...@hauke-m.de>;
> Christian Lamparter <chunk...@gmail.com>
> Cc: Florian Fainelli <f.faine...@gmail.com>; openwrt-devel@lists.openwrt.org;
> Linus Walleij <linus.wall...@linaro.org>
> Subject: [PATCH] gemini: Add hdparm setting
> 
> This uses "hdparm" (if present) to get the harddisk into low power mode on
> NAS set-ups.
> 
> Signed-off-by: Linus Walleij <linus.wall...@linaro.org>
> ---
>  .../linux/gemini/base-files/etc/board.d/03_hdparm | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>  create mode 100755 target/linux/gemini/base-files/etc/board.d/03_hdparm
> 
> diff --git a/target/linux/gemini/base-files/etc/board.d/03_hdparm
> b/target/linux/gemini/base-files/etc/board.d/03_hdparm
> new file mode 100755
> index 000000000000..68d76f0acdf8
> --- /dev/null
> +++ b/target/linux/gemini/base-files/etc/board.d/03_hdparm
> @@ -0,0 +1,15 @@
> +#!/bin/sh

board.d files are not executable anymore. Please remove shebang and execute bit.

Please add an SPDX license identifier instead.

> +# Spin down drives after one minute if inactive
> +
> +which hdparm > /dev/null

I think using which has been discouraged lately in favor of command -v ...

> +if [ ! $? -eq 0 ] ; then

"$?" != 0 ?

> +     exit 0
> +fi
> +
> +DISKS=`find /dev/sd[a-z] 2>/dev/null`

Please use $() instead of backticks.

Best

Adrian

> +for DISK in $DISKS
> +do
> +     if [ -b $DISK ] ; then
> +             hdparm -S 12 /dev/sda > /dev/null
> +     fi
> +done
> --
> 2.31.1
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Attachment: openpgp-digital-signature.asc
Description: PGP signature

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to