suspend2_resume() {
if [ -d /proc/tuxonice ] || [ -d /sys/power/tuxonice ]; then
local splash_theme
if grep "splash=" /proc/cmdline > /dev/null 2>&1; then
splash_theme=`cat /proc/cmdline | sed 's/.*splash=/splash=/' | sed 's/ .*//' | sed 's/.*theme://' | sed 's/,.*//'`
fi
local suspend2_userui_program="/sys/power/tuxonice/user_interface/program"
local suspend2_do_resume="/sys/power/tuxonice/do_resume"
#
# Backward compatibility
#
if [ -e /proc/suspend2 ]; then
suspend2_userui_program="/proc/tuxonice/userui_program"
suspend2_do_resume="/proc/tuxonice/do_resume"
fi
modules_scan suspend2
if which suspend2ui_text > /dev/null 2>&1; then
which suspend2ui_text > "${suspend2_userui_program}"
fi
if [ -n "${splash_theme}" ]; then
ln -s /etc/splash/${splash_theme} /etc/splash/suspend2
if which suspend2ui_fbsplash > /dev/null 2>&1; then
which suspend2ui_fbsplash > "${suspend2_userui_program}"
fi
fi
echo > "${suspend2_do_resume}"
fi
}