#!/bin/bash

echo "Resoring the original do_ni_hypercall()..."
if [ ! -f userinput.orig ]; then
	echo Error: userinput.orig not found! Cannot restore!
	exit 1
fi

cp userinput.orig userinput

echo Restoring Xen memory via DMA trick...
./userwrite
if [ ! $? = 0 ]; then
	echo Error executing userwrite!
	exit 1
fi

echo Removing the driect_hdd module...

rmmod direct

echo Done.
