Nexus 5 gives Status 7 error when flashing 5.1 OTA
Your clue is in the output log:


  "System/bin/install-recovery.sh" has unexpected contents.


Since Android 5, OTA installs verify each partition as a whole so any changes will result in verification failing even if the file is not changed by the update. Something has changed the install-recovery.sh file, so you will need to revert the change or copy the original file back from a backup.