( cd usr/bin ; rm -rf ypchfn )
( cd usr/bin ; ln -sf yppasswd ypchfn )
( cd usr/bin ; rm -rf ypchsh )
( cd usr/bin ; ln -sf yppasswd ypchsh )
# Process the incoming configuration files

if [ ! -f etc/netgroup ]
then
   mv install/conf/etc/netgroup etc/netgroup
else
   if [ "`md5sum install/conf/etc/netgroup | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/netgroup | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/netgroup etc/netgroup
   else
      rm install/conf/etc/netgroup
   fi
fi

if [ ! -f etc/nsswitch.conf ]
then
   mv install/conf/etc/nsswitch.conf etc/nsswitch.conf
else
   if [ "`md5sum install/conf/etc/nsswitch.conf | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/nsswitch.conf | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/nsswitch.conf etc/nsswitch.conf
   else
      rm install/conf/etc/nsswitch.conf
   fi
fi

if [ ! -f etc/nsswitch.conf-nis ]
then
   mv install/conf/etc/nsswitch.conf-nis etc/nsswitch.conf-nis
else
   if [ "`md5sum install/conf/etc/nsswitch.conf-nis | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/nsswitch.conf-nis | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/nsswitch.conf-nis etc/nsswitch.conf-nis
   else
      rm install/conf/etc/nsswitch.conf-nis
   fi
fi

if [ ! -f var/yp/Makefile ]
then
   mv install/conf/var/yp/Makefile var/yp/Makefile
else
   if [ "`md5sum install/conf/var/yp/Makefile | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum var/yp/Makefile | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/var/yp/Makefile var/yp/Makefile
   else
      rm install/conf/var/yp/Makefile
   fi
fi

if [ ! -f var/yp/securenets ]
then
   mv install/conf/var/yp/securenets var/yp/securenets
else
   if [ "`md5sum install/conf/var/yp/securenets | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum var/yp/securenets | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/var/yp/securenets var/yp/securenets
   else
      rm install/conf/var/yp/securenets
   fi
fi

if [ ! -f var/yp/nicknames ]
then
   mv install/conf/var/yp/nicknames var/yp/nicknames
else
   if [ "`md5sum install/conf/var/yp/nicknames | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum var/yp/nicknames | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/var/yp/nicknames var/yp/nicknames
   else
      rm install/conf/var/yp/nicknames
   fi
fi

# Make sure the incoming conf directory is gone
rm -rf install/conf
