#!/bin/sh
# Written by John Newbigin
# jn@it.swin.edu.au
# Copyright (c) 1999 John Newbigin
# Covered by the terms of the GPL.
# $Header: /home/itig/cvsroot/ndu/src/dnsedit,v 1.5 2001/02/06 02:35:26 jn Exp $

# part of ndu

if [ ! -x "$EDITOR" ] ; then
   EDITOR=/bin/vi
fi;

umask 027
if [ -f "$1" ] ; then
	tempfile=/tmp/`date +%s`.dns
	/bin/cp $1 $tempfile
	$EDITOR $1
	if /usr/bin/diff $1 $tempfile >> /dev/null ; then
	  echo No changed made
	else
		/usr/bin/dnstouch $1
		/usr/bin/ndu
#		/usr/sbin/ndc reload
		echo updated
	fi
else
	echo file does not exist
fi;

