HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //usr/syno/bin/DiskApmSet.sh
#! /bin/sh
# Copyright (c) 2003-2014 Synology Inc. All rights reserved.
#
# Check the disk supports APM or not. If yes, set the APM setting.
#
# Usage:
#       DiskApmSet.sh APM_LEVEL DISK_DEV_NODE
#       ex: DiskApmSet.sh 255 /dev/sda      Disable APM on /dev/sda

# Check input valid
if [ -z $1 ] || [ -z $2 ]; then
	exit
fi

# Check the disk supports APM
if [ `/usr/bin/hdparm -B $2 | grep -c 'not supported'` -lt 1 ]; then
	# Set APM setting
	/usr/bin/hdparm -B $1 $2 > /dev/null 2>&1
fi