Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:[email protected]]
> On Behalf Of Linus Walleij
> Sent: Montag, 5. Juli 2021 00:01
> To: Sebastian Luft <[email protected]>; Hans Ulli Kroll
> <[email protected]>; Hauke Mehrtens <[email protected]>;
> Christian Lamparter <[email protected]>
> Cc: Florian Fainelli <[email protected]>; [email protected];
> Linus Walleij <[email protected]>
> 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 <[email protected]>
> ---
>  .../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
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

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

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to