#!/bin/sh
#
# fm_overwrite 
#
# Copyright (c) 1992-1993 Frame Technology Corp. All rights reserved.
# If the file named by $1 exists, ask the user if he wants to overwrite
# it.  If he agrees, remove the file and exit 0; otherwise exit nonzero.
#
# $Id: fm_overwrite,v 1.3 1992/11/10 12:31:42 sbs Exp $

: ${1:?}
if [ -f "$1" ]; then
	if $FMHOME/bin/scripts/fm_ask y n "OK to overwrite existing file $1?"
	then
		rm -f "$1"
	fi
fi

if [ -f "$1" ]; then
	echo "
""The file \"$1\" was NOT overwritten.
" >&2
	exit 1
fi
exit 0
