]>
Commit | Line | Data |
---|---|---|
1aefb26c SP |
1 | #!/bin/sh |
2 | # EeePC Configuration restore | |
3 | # | |
4 | ### BEGIN INIT INFO | |
5 | # Provides: eeepc-restore | |
6 | # Short-Description: Restores EeePC settings from last boot. | |
7 | # chkconfig: 234 | |
8 | ### END INIT INFO | |
9 | ||
10 | set -e | |
11 | ||
12 | # Source function library | |
13 | . /etc/rc.d/init.d/functions | |
14 | ||
15 | # Get service config | |
b39b4967 | 16 | [ -f /etc/sysconfig/eeepc-acpi ] && . /etc/sysconfig/eeepc-acpi |
1aefb26c SP |
17 | |
18 | case "$1" in | |
19 | restart|reload|force-reload|start) | |
20 | (grep EEEPC_MODEL /etc/default/eeepc-acpi >/dev/null 2>&1) || echo "EEEPC_MODEL=$(dmidecode -s system-product-name)" >> /etc/default/eeepc-acpi | |
21 | ||
22 | (grep EEEPC_CPU /etc/default/eeepc-acpi >/dev/null 2>&1) || echo "EEEPC_CPU=`((grep Celeron /proc/cpuinfo >/dev/null 2>&1) && echo Celeron) || echo Atom`" >> /etc/default/eeepc-acpi | |
23 | ||
24 | if [ "$BOOT_BLUETOOTH" = "1" ]; then | |
25 | if [ -e "$EEEPC_VAR/bt_saved" ]; then | |
26 | $EEEPC_PATH/eeepc-bluetooth-toggle.sh restore 2>/dev/null & | |
27 | fi | |
28 | fi | |
29 | ||
30 | if [ "$BOOT_CAMERA" = "1" ]; then | |
31 | if [ -e "$EEEPC_VAR/cam_saved" ]; then | |
32 | $EEEPC_PATH/eeepc-camera-toggle.sh restore 2>/dev/null & | |
33 | fi | |
34 | fi | |
35 | ||
36 | if [ "$BOOT_CPUFREQ" = "1" ]; then | |
37 | if [ -e "$EEEPC_VAR/cpu_mode" ]; then | |
38 | (sleep $BOOT_CPU_DELAY; $EEEPC_PATH/eeepc-cpu-control.sh restore 2>/dev/null) & | |
39 | fi | |
40 | fi | |
41 | ||
42 | if [ "$BOOT_WIFI" = "1" ]; then | |
43 | if [ -e "$EEEPC_VAR/eeepc-wifi-saved" ]; then | |
44 | $EEEPC_PATH/eeepc-wifi-toggle.sh restore 2>/dev/null & | |
45 | fi | |
46 | fi | |
47 | ;; | |
48 | ||
49 | client) | |
50 | ||
51 | if [ "$BOOT_TOUCHPAD" = "1" ]; then | |
52 | if [ -e "$EEEPC_VAR/touchpad_saved" ]; then | |
53 | $EEEPC_PATH/eeepc-touchpad-toggle.sh restore 2>/dev/null & | |
54 | fi | |
55 | fi | |
56 | ||
57 | if [ "$BOOT_VGA" = "1" ]; then | |
58 | if [ -e "$EEEPC_VAR/vga_saved" ]; then | |
59 | $EEEPC_PATH/eeepc-vga-toggle.sh restore 2>/dev/null & | |
60 | fi | |
61 | fi | |
62 | ||
63 | if [ "$BOOT_ROTATION" = "1" ]; then | |
64 | if [ -e "$EEEPC_VAR/rotation_saved" ]; then | |
65 | $EEEPC_PATH/eeepc-rotate-lvds.sh restore 2>/dev/null & | |
66 | fi | |
67 | fi | |
68 | ||
69 | if [ "$BOOT_RESOLUTION" = "1" ]; then | |
70 | if [ -e "$EEEPC_VAR/resolution_saved" ] ; then | |
71 | $EEEPC_PATH/eeepc-lvds-resolution-toggle.sh restore 2>/dev/null & | |
72 | fi | |
73 | fi | |
74 | ;; | |
75 | stop) | |
76 | ;; | |
77 | esac | |
78 | ||
79 | exit 0 |