1config() { 2 NEW="$1" 3 OLD="`dirname $NEW`/`basename $NEW .new`" 4 # If there's no config file by that name, mv it over: 5 if [ ! -r $OLD ]; then 6 mv $NEW $OLD 7 elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy 8 rm $NEW 9 fi 10 # Otherwise, we leave the .new copy for the admin to consider... 11} 12config etc/dnsmasq.conf.new 13config etc/rc.d/rc.dnsmasq.new 14 15# This should be mostly useless... 16rm -f etc/rc.d/rc.dnsmasq.new 17