#!/bin/sh # EeePC Configuration restore # ### BEGIN INIT INFO # Provides: eeepc-restore # Short-Description: Restores EeePC settings from last boot. # chkconfig: 234 ### END INIT INFO set -e # Source function library . /etc/rc.d/init.d/functions # Get service config [ -f /etc/sysconfig/eeepc-acpi ] && . /etc/sysconfig/eeepc-acpi case "$1" in restart|reload|force-reload|start) (grep EEEPC_MODEL /etc/default/eeepc-acpi >/dev/null 2>&1) || echo "EEEPC_MODEL=$(dmidecode -s system-product-name)" >> /etc/default/eeepc-acpi (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 if [ "$BOOT_BLUETOOTH" = "1" ]; then if [ -e "$EEEPC_VAR/bt_saved" ]; then $EEEPC_PATH/eeepc-bluetooth-toggle.sh restore 2>/dev/null & fi fi if [ "$BOOT_CAMERA" = "1" ]; then if [ -e "$EEEPC_VAR/cam_saved" ]; then $EEEPC_PATH/eeepc-camera-toggle.sh restore 2>/dev/null & fi fi if [ "$BOOT_CPUFREQ" = "1" ]; then if [ -e "$EEEPC_VAR/cpu_mode" ]; then (sleep $BOOT_CPU_DELAY; $EEEPC_PATH/eeepc-cpu-control.sh restore 2>/dev/null) & fi fi if [ "$BOOT_WIFI" = "1" ]; then if [ -e "$EEEPC_VAR/eeepc-wifi-saved" ]; then $EEEPC_PATH/eeepc-wifi-toggle.sh restore 2>/dev/null & fi fi ;; client) if [ "$BOOT_TOUCHPAD" = "1" ]; then if [ -e "$EEEPC_VAR/touchpad_saved" ]; then $EEEPC_PATH/eeepc-touchpad-toggle.sh restore 2>/dev/null & fi fi if [ "$BOOT_VGA" = "1" ]; then if [ -e "$EEEPC_VAR/vga_saved" ]; then $EEEPC_PATH/eeepc-vga-toggle.sh restore 2>/dev/null & fi fi if [ "$BOOT_ROTATION" = "1" ]; then if [ -e "$EEEPC_VAR/rotation_saved" ]; then $EEEPC_PATH/eeepc-rotate-lvds.sh restore 2>/dev/null & fi fi if [ "$BOOT_RESOLUTION" = "1" ]; then if [ -e "$EEEPC_VAR/resolution_saved" ] ; then $EEEPC_PATH/eeepc-lvds-resolution-toggle.sh restore 2>/dev/null & fi fi ;; stop) ;; esac exit 0