- set -e
-
- # Remember the previous sequence number
- prevSequenceNumber=$sequenceNumber
-
- # Read in new state
- . state.txt
-
- # Did we get any new data?
- if [ "${sequenceNumber}" == "${prevSequenceNumber}" ]
- then
- # Log the lack of data
- echo "No new data available. Sleeping..."
-
- # Remove file, it will just be an empty changeset
- rm ${file}
-
- # No need to rollback now
- rm state-prev.txt