#!/bin/sh
# preinst script for manage-hybrid-sleep
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in
    configure)
	if cat /sys/class/dmi/id/modalias | grep -q "Inspiron7559" ; then
		mkdir -p /etc/default/grub.d
		echo "GRUB_CMDLINE_LINUX=\$(echo \$GRUB_CMDLINE_LINUX acpi_osi=! acpi_osi=\\\"Windows 2013\\\")" > /etc/default/grub.d/pan5s_acpi_osi.cfg
		update-grub
	fi
        exit 0
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        exit 0
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
