26
echo -n "Enabling laptop mode: "
28
log_action_begin_msg "Enabling laptop mode"
27
29
touch /var/run/laptop-mode-enabled
28
/usr/sbin/laptop_mode auto init
30
RESULT=$(/usr/sbin/laptop_mode auto init)
31
log_action_end_msg 0 "$RESULT"
32
34
restart|reload|force-reload)
34
echo -n "Restarting laptop mode: "
35
/usr/sbin/laptop_mode auto init force
36
log_action_begin_msg "Stopping laptop mode"
38
# Full restart: first stop laptop mode completely (to restore default mount options etc.)
39
rm -f /var/run/laptop-mode-enabled
40
RESULT=$(/usr/sbin/laptop_mode stop init)
41
log_action_end_msg 0 "$RESULT"
43
# Now remove files containing stored status, re-enable, and start it up again.
44
rm -f /var/run/laptop-mode-*
45
touch /var/run/laptop-mode-enabled
46
log_action_begin_msg "Starting laptop mode"
47
RESULT=$(/usr/sbin/laptop_mode auto init force)
48
log_action_end_msg 0 "$RESULT"
40
52
rm -f /var/run/laptop-mode-enabled
41
echo -n "Disabling laptop mode: "
42
if ! ( /usr/sbin/laptop_mode stop init ) ; then
53
log_action_begin_msg "Disabling laptop mode"
54
RESULT=$(/usr/sbin/laptop_mode stop init)
56
log_action_end_msg 1 "$RESULT"
50
63
echo "Laptop mode status:"
52
65
/usr/sbin/laptop_mode status
57
echo "Usage: $0 {stop|start|restart|reload|force-reload|status}" >&2
69
echo "Usage: $0 {stop|start|restart|reload|force-reload|status}" >&2