#!/bin/bash

if [[ `whoami` != "root" ]]; then
	sudo $0
	exit
fi

cp /etc/resolv.conf edit/etc/
cp /etc/hosts edit/etc/
rm edit/etc/localtime || true
cp /etc/localtime edit/etc/
mount --bind /dev edit/dev
mount --bind /proc edit/proc
mount --bind /sys edit/sys
mount --bind /tmp edit/tmp
xhost +local:root
HOME=/root LC_ALL=C chroot edit /bin/bash
xhost -local:root
umount edit/proc
umount edit/sys
umount edit/tmp
umount edit/dev
#umount edit/lib/modules/2.6.24-19-generic/volatile/
rm edit/etc/resolv.conf
rm edit/etc/hosts
rm edit/etc/localtime || true
ln -s /usr/share/zoneinfo/UTC edit/etc/localtime
