#!/bin/sh

# adapted from Jukka's suspend2ram script

sync

# Switch away from X to avoid crash during wake-up
chvt 1

# suspend to RAM
echo -n mem > /sys/power/state

# After the suspend, we restart here...

# Reset video hardware as ACPI does not do this properly
# http://bugzilla.kernel.org/show_bug.cgi?id=3670
/root/emu/video_post

# Switch back to X session in VT 7
/usr/bin/chvt 7

exit 0
