403Webshell
Server IP : 107.13.46.68  /  Your IP : 216.73.216.232
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux mariOS 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/sbin/pm-powersave
#!/bin/sh
# vim:noexpandtab
# Simple powersave script
#
# Copyright 2006 Red Hat, Inc.
#
# Based on work from:
#    Bill Nottingham <notting@redhat.com>
#    Peter Jones <pjones@redhat.com>
#    David Zeuthen <davidz@redhat.com>
#    Richard Hughes <richard@hughsie.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

export STASHNAME=pm-powersave
. "/usr/lib/pm-utils/pm-functions"

remove_powersave_lock() {
    release_lock "${STASHNAME}.lock"
}

help() {
    cat <<EOF
$0: Valid options are:
false or ac = turn powersaving features off.
true or battery = turn powersaving features on.
help = get detailed help.

EOF
if [ "$1" = "--help" ]; then
    cat <<EOF
The rest of this help message displays the variables
that can be used to tune the powersave hooks.  
You can change these variables using pm-utils config files.
(see the pm-utils README for more information)

EOF
else
    echo "You can get more detailed information by running pm-powersave --help"
fi
}

lock_and_load() {
# take the powersave lock.
# ensure it gets released no matter how we exit.
    try_lock "${STASHNAME}.lock" || exit 1
    trap remove_powersave_lock 0
    mkdir -p "${STORAGEDIR}"
    rm -f "${INHIBIT}"
    
    load_hook_blacklist
    
    init_logfile "${PM_LOGFILE}"
}

_on_ac_power() {
    on_ac_power
    case $? in
        # If on_ac_power can't determine AC power state (255), assume it's a desktop.
        0|255) return 0 ;;
        1) return 1 ;;
    esac
}

case $1 in
    true|battery) lock_and_load && run_hooks power true;;
    false|ac) lock_and_load && run_hooks power false;;
    --help) help && run_hooks power help;;
    '') lock_and_load; _on_ac_power && run_hooks power false || run_hooks power true;;
    *) help && exit 1;;
esac

Youez - 2016 - github.com/yon3zu
LinuXploit