#!/bin/ksh 

RM="/usr/bin/rm"
MKDIR="/usr/bin/mkdir"

if [ ! -d $FLASH_ROOT/etc/flash ] ; then
    $MKDIR $FLASH_ROOT/etc/flash
fi

/usr/bin/cp -r /tmp/flash_tmp/reboot $FLASH_ROOT/etc/flash
if [ $? != 0 ] ; then
	$RM -rf $FLASH_DIR
	echo "$(gettext "Can not set reboot customization scripts")"
	exit 1
fi

/usr/bin/cp /tmp/flash_tmp/reboot_processing $FLASH_ROOT/etc/init.d/flash_reboot_processing
if [ $? != 0 ] ; then
	$RM -rf $FLASH_DIR
	echo "$(gettext "Can not set reboot customization scripts")"
	exit 1
fi

if [ ! -L $FLASH_ROOT/etc/rc2.d/S98flash_reboot ] ; then
	/usr/bin/ln $FLASH_ROOT/etc/init.d/flash_reboot_processing $FLASH_ROOT/etc/rc2.d/S98flash_reboot
	if [ $? != 0 ] ; then
		$RM -rf $FLASH_DIR
		echo "$(gettext "Can not set reboot customization scripts")"
		exit 1
	fi
fi

exit 0
