Can you tell me the cases you solve with all the "if"s you introduce in the bash part of your script?