You are right, part
# Compare files, ignore white spaces, modification, etc
diff -b -B -q ${SRC} ${DST}
if [ $? -eq 1 ]; then
#XXX: When is disks is already mounted for some reason (other process, script call, make sure to keep it's previous state
mount -uwo noatime /cfg
cp ${SRC} ${DST}
umount /cfg
fi
needs to include extra check on non existence
# Compare files, ignore white spaces, modification, etc
diff -b -B -q ${SRC} ${DST}; RETVAL=$?
if [ [ $RETVAL -ne 0 ]; then
#2: DST does not yet, exists, 1: file differs
#XXX: When is disks is already mounted for some reason (other process, script call, make sure to keep it's previous state
mount -uwo noatime /cfg
cp ${SRC} ${DST}
umount /cfg
fi