#!/bin/sh


if [ "$1" = install ]; then
	dpkg-divert --package netbook-config-natick --divert /etc/X11/xorg.conf.orig --rename /etc/X11/xorg.conf
elif [ "$1" = upgrade ]; then
	if [ -e "/etc/X11/xorg.conf" ]; then
		mv /etc/X11/xorg.conf /etc/X11/xorg.conf.netbook
	fi

	# Don't exit on error since its possible some upstart tasks do not
	# need to be moved
	set +e

	# Restore upstart tasks to their state when installed so dpkg will find them
	# in the same location and can properly update them.
	update-upstart enable firstboot-config

	set -e

fi

