#! /bin/sh
set -e

#
# make symlink /sbin/fdisk point to the native fdisk
#

# This is also true if /sbin/fdisk is a dangling symlink; in that case we
# want to update the link, too.

export PATH=/bin:/usr/bin

if [ ! -e /sbin/fdisk ]; then
	machine=""
	case `awk '$1 == "Model:" { print $2 }' /proc/hardware` in
		Atari)
			machine=atari
			;;
		Amiga)
			machine=amiga
			;;
		Macintosh)
			machine=mac
			;;
		Motorola) # MVME
			;;
	esac
	if [ -n "$machine" -a -f /sbin/$machine-fdisk ]; then
		ln -sf $machine-fdisk /sbin/fdisk
	else
		echo "No native fdisk for this machine type!"
	fi
fi



exit 0
