File: vbesave

package info (click to toggle)
acpi-support 0.143-5.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 828 kB
  • sloc: sh: 816; ansic: 131; makefile: 38
file content (58 lines) | stat: -rw-r--r-- 1,357 bytes parent folder | download | duplicates (9)
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
#!/bin/sh

### BEGIN INIT INFO
# Provides:          vbesave
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      
# Short-Description: Save VESA state at boot time
# Description:       VESA state is saved at boot time so that it can be
#                    restored later to a sane state for example after a suspend.
### END INIT INFO

test -f /usr/share/acpi-support/power-funcs || exit 0

test -x /usr/sbin/vbetool || exit 0
set -e

. /lib/lsb/init-functions

test -f /etc/default/rcS && . /etc/default/rcS
test -f /etc/default/acpi-support && . /etc/default/acpi-support
test -f /usr/share/acpi-support/device-funcs && . /usr/share/acpi-support/device-funcs

case "$1" in
 start)
	if laptop-detect > /dev/null; then
		LAPTOP=true;
	fi

	if [ x$LAPTOP != xtrue ]; then
		exit 0;
	fi

        DeviceConfig
	log_begin_msg "Saving VESA state..."
	if [ "$SAVE_VBE_STATE" = "true" ]; then
	    if [ "$VERBOSE" = no ]; then 
		if ! vbetool vbestate save > $VBESTATE 2>/dev/null; then
		    log_end_msg $?
		    exit 1
		fi
	    else
		if ! vbetool vbestate save > $VBESTATE ; then
		    log_end_msg $?
		    exit 1
		fi
	    fi
	    log_end_msg 0
        fi
        ;;
 stop|restart|force-reload)
	# Doesn't make sense (and shut up lintian)
	;;
 *)
        exit 0
        ;;
esac