Fix several bashate issues

* E001: Trailing Whitespace
* E003: Indent not multiple of 4
* E010: Do not on same line as for
* E011: Then keyword is not on same line as if keyword
* E020: Function declaration not in format
        "^function name {$": 'function check_file() {'

Change-Id: I73724bd2dfb9c908900919ce7b769c410a06eb1d