I think you should try the suggestions in the article Start shell script on Network Manager successful connection .