#! /bin/sh

set -e

. /usr/share/debconf/confmodule

if [ "configure" = "$1" ] && [ -z "$2" ]; then 
    cat > /etc/network/interfaces <<EOF
auto lo
iface lo inet loopback
EOF
    
fi

# run oem-config-prepare only on initial pacakge install
if [ "configure" = "$1" ] && [ -z "$2" ]; then 
    oem-config-prepare --quiet
fi

# Ew
if [ -f /etc/X11/Xwrapper.config ]; then
    sed -i -e 's/allowed_users=.*/allowed_users=anybody/' /etc/X11/Xwrapper.config
fi

# Double ew. Hack to work around unionfs bug/feature.
if [ ! -L /squashmnt ]; then
	ln -s / /squashmnt
fi

[ -x "/etc/X11/xorg.conf.netbook" ] && mv /etc/X11/xorg.conf.netbook /etc/X11/xorg.conf

#DEBHELPER#
