#!/bin/bash #============================================================================== # Author: Stefan Bader # Copyright (C) 2010 # # This script is distributed under the terms and conditions of the GNU General # Public License, Version 3 or later. See http://www.gnu.org/copyleft/gpl.html # for details. #============================================================================== # # For now this needs dmi information in /sys, otherwise just skip it. # DMIDIR=/sys/class/dmi/id if [ ! -d $DMIDIR ]; then exit 0 fi # # Only change the method for hibernate # if [ "$1" != "hibernate" ]; then exit 0 fi # # Do not overwrite a setting which has been made by the user or some config # file. # if [ "$HIBERNATE_MODE" != "" ]; then exit 0 fi # # Use special quirks for systems we know are needing them. Changing variable # HIBERNATE_MODE from within a hook won't get passed up, so its directly set # here. # HIBMETH=/sys/power/disk case "$(cat $DMIDIR/sys_vendor)" in Acer*) case "$(cat $DMIDIR/product_name)" in TravelMate\ 8100) echo "shutdown" >$HIBMETH ;; esac ;; esac exit 0