This file is indexed.

/etc/init.d/laptop-mode is in laptop-mode-tools 1.64-1ubuntu1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#! /bin/sh
#
# chkconfig: - 99 99
# description: Starts and stops "laptop-mode" - tweaks system behavior
#              to extend battery life.
#
# config:  /etc/laptop-mode/laptop-mode.conf

### BEGIN INIT INFO
# Provides:          laptop-mode
# Should-Start:      $all
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Enable laptop-mode-tools power management functions
# Description:       Enable laptop-mode-tools power management functions
### END INIT INFO

test -f /usr/sbin/laptop_mode || exit 0

if [ -f /lib/lsb/init-functions ] ; then
  . /lib/lsb/init-functions
else
  log_success_msg()
  {
    logger -t LAPTOP-MODE -p daemon.info -- $*
    echo "$*"
  }
  log_failure_msg()
  {
    logger -t LAPTOP-MODE -p daemon.notice -- $*
    echo "$*"
  }
fi

# Enable laptop mode when the system is booted when running on battery.

case $1 in
  start)
    mkdir -p /var/run/laptop-mode-tools
    touch /var/run/laptop-mode-tools/enabled
    if RESULT=`/usr/sbin/laptop_mode auto` ; then
      log_success_msg "$RESULT"
    else
      log_failure_msg "$RESULT"
    fi
    ;;

  restart|reload|force-reload)
    # Full restart: first stop laptop mode completely (to restore default mount options etc.)
    mkdir -p /var/run/laptop-mode-tools
    rm -f /var/run/laptop-mode-tools/enabled    
    if RESULT=`/usr/sbin/laptop_mode stop` ; then
      log_success_msg "$RESULT"
    else
      log_failure_msg "$RESULT"
    fi

    # Now remove files containing stored status, re-enable, and start it up again.
    rm -f /var/run/laptop-mode-tools/*
    touch /var/run/laptop-mode-tools/enabled
    if RESULT=`/usr/sbin/laptop_mode auto force` ; then
      log_success_msg "$RESULT"
    else
      log_failure_msg "$RESULT"
    fi
    ;;

  stop)
    rm -f /var/run/laptop-mode-tools/enabled
    if RESULT=`/usr/sbin/laptop_mode stop` ; then
      log_success_msg "$RESULT"
    else
      log_failure_msg "$RESULT"
    fi
    ;;

  status)
    echo "Laptop mode status:"
    echo
    /usr/sbin/laptop_mode status
    ;;
    
  *)
    echo "Usage: $0 {stop|start|restart|reload|force-reload|status}" >&2
    exit 2
    ;;
esac

exit 0