#!/bin/sh

echo 
echo "Trinux will save configuration information to the /tux directory"
echo "on a DOS formatted floppy or to C:\trinux\tux\ if you booted "
echo "from a fixed disk using loadlin"

if [ -f /etc/proc/boot ]
then
	BOOT=`cat /etc/proc/boot`
else
	BOOT="/dev/fd0"	
fi

echo
echo "Boot device: $BOOT"

if [ "$BOOT" = "/dev/fd0" ]
then
	echo -n "Please enter your boot/config floppy, then hit return: "
	read blah
else
	PREFIX="/trinux"
fi

if mount -t vfat $BOOT /boot 
then
	echo "Backing up old configuration"
	cd /boot${PREFIX} 
	rm -r tux.bak 2> /dev/null
	mv tux tux.bak
	cp -a /etc/tux .

	echo "Unmounting $BOOT"
	cd /; umount /boot
else
	echo "Unable to mount boot device!"
fi
