| OLD | NEW |
| 1 #! /bin/sh | 1 #! /bin/sh |
| 2 # | 2 # |
| 3 # Script to start or stop laptop_mode, and to control various settings of the | 3 # Script to start or stop laptop_mode, and to control various settings of the |
| 4 # kernel, hardware etc. that influence power consumption. | 4 # kernel, hardware etc. that influence power consumption. |
| 5 # | 5 # |
| 6 # This script is a part of Laptop Mode Tools. If you are running a supported | 6 # This script is a part of Laptop Mode Tools. If you are running a supported |
| 7 # power management daemon, this script will be automatically called on power | 7 # power management daemon, this script will be automatically called on power |
| 8 # state change. | 8 # state change. |
| 9 # | 9 # |
| 10 # Configure laptop mode tools in /etc/laptop-mode/laptop-mode.conf, and in | 10 # Configure laptop mode tools in /etc/laptop-mode/laptop-mode.conf, and in |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 # modules and logging | 153 # modules and logging |
| 154 if [ -x $LOGGER -a "$1" != "STATUS" ]; then | 154 if [ -x $LOGGER -a "$1" != "STATUS" ]; then |
| 155 #if [ -z $2 ]; then | 155 #if [ -z $2 ]; then |
| 156 # continue | 156 # continue |
| 157 #elif [ "$1" = "MSG" ]; then | 157 #elif [ "$1" = "MSG" ]; then |
| 158 if [ "$1" = "MSG" ]; then | 158 if [ "$1" = "MSG" ]; then |
| 159 logger -p $SYSLOG_FACILITY.info -t laptop-mode "$2"; | 159 logger -p $SYSLOG_FACILITY.info -t laptop-mode "$2"; |
| 160 elif [ "$1" = "ERR" ]; then | 160 elif [ "$1" = "ERR" ]; then |
| 161 logger -p $SYSLOG_FACILITY.err -t laptop-mode "$2"; | 161 logger -p $SYSLOG_FACILITY.err -t laptop-mode "$2"; |
| 162 elif [ "$1" = "VERBOSE" ]; then | 162 elif [ "$1" = "VERBOSE" ]; then |
| 163 logger -p $SYSLOG_FACILITY.debug -t laptop-mode "$2"; | 163 if [ "$DEBUG" = 1 ]; then |
| 164 » logger -p $SYSLOG_FACILITY.debug -t laptop-mode "$2"; |
| 165 » fi |
| 164 else | 166 else |
| 165 logger -p $SYSLOG_FACILITY.notice -t laptop-mode "$2"; | 167 logger -p $SYSLOG_FACILITY.notice -t laptop-mode "$2"; |
| 166 fi | 168 fi |
| 167 fi | 169 fi |
| 168 fi | 170 fi |
| 169 | 171 |
| 170 if [ "$1" = "VERBOSE" ]; then | 172 if [ "$1" = "VERBOSE" ]; then |
| 171 $LM_VERBOSE && echo "$2" >/dev/fd/2; | 173 $LM_VERBOSE && echo "$2" >/dev/fd/2; |
| 172 elif [ "$1" = "ERR" ]; then | 174 elif [ "$1" = "ERR" ]; then |
| 173 echo "$2" >/dev/fd/2; | 175 echo "$2" >/dev/fd/2; |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 log "VERBOSE" "Module $SCRIPT is not executable." | 1024 log "VERBOSE" "Module $SCRIPT is not executable." |
| 1023 fi | 1025 fi |
| 1024 done | 1026 done |
| 1025 | 1027 |
| 1026 | 1028 |
| 1027 exit 0 | 1029 exit 0 |
| 1028 | 1030 |
| 1029 # This fi closes the if for "readconfig". If I would have indented this one | 1031 # This fi closes the if for "readconfig". If I would have indented this one |
| 1030 # I would have indented the whole file. :) | 1032 # I would have indented the whole file. :) |
| 1031 fi | 1033 fi |
| OLD | NEW |