Bash code style

Hello!
I was just passing by and thought I'd fix some errors in your bash script. I have also made many style improvements according to best practices and common sense.

Although most of these changes are pretty obvious, it is still possible that I broke something. I did not even run that script, so please test it carefully.

Please note that this line (and there is another similar line):
``    if grep -i 'adaptec' <<< "$parted_diag"; then``
bumps the required bash version to 4.0+
If you want to support bash 3, then change it to
``    if printf "%s" "$parted_diag" | grep -i 'adaptec'; then``
And there is a high chance that you don't even need grep for this task. However, I don't know the expected output of ``parted -ls``, so I will not introduce any further changes.

If you have some free time please read these:
http://mywiki.wooledge.org/BashPitfalls
http://mywiki.wooledge.org/BashGuide/Practices
http://mywiki.wooledge.org/BashFAQ
This is very important if you ever plan to write any bash scripts.