Sooo, I guess a couple of things.
What error do you get when you try to boot it not in rescue mode?
Was your /home directory a separate partition?
I don’t think networking neccesarily starts in rescue mode, so you getting a response that 127.0.0.1:8118 is unreachable probably makes sense (your tor proxy will rely on the network service afterall)
I’ve used shfmt in the past: https://github.com/patrickvane/shfmt