#!/bin/sh -hp CLEANUP=/tmp/$ACTIVE_PATCH.log.FiLe while read src dst do # # A before and after snapshot was taken of the editable file. # If the editable file matches the "after" version then it wasn't # modified and can restored to it's previous version. # efile_name=`basename $dst` if [ ! -f $PKGSAV/$efile_name.$ACTIVE_PATCH ] || [ ! -f $PKGSAV/$efile_name.old.$ACTIVE_PATCH ] ; then echo "Unable to restore $dst." >> $CLEANUP exit 0 fi cmp -s $dst $PKGSAV/$efile_name.$ACTIVE_PATCH if [ $? -eq 0 ] ; then # Seems that dst has not been modified. mv $PKGSAV/$efile_name.old.$ACTIVE_PATCH $dst rm $PKGSAV/$efile_name.$ACTIVE_PATCH echo "Restored $dst" >> $CLEANUP fi done exit 0