How to improve my auto-reconnection Python script
I'd move the contents of the script into a main function and then use the if __name__ == '__main__' boilerplate to start it.
I wouldn't use external tools like bash/sed/grep to do additional logic. I'd implement that logic in python.
I'd use the communicate method for POpen objects rather then reading the stdout attribute
Your POpens are all very similiar. I'd write a function that takes a command line executes it and returns the standard output
You check if you are connected in multiple places, write a am_connected() function which returns True or False and use it multiple times
I'd probably write a function for each external command you execute even if they are not repeated because it'll make your code cleaner.