Re: Login, su to root, execute command (General questions)
Kaliorin,
I cannot know what happens and why it doens't work. I suggest you try line at a time - make sure Connect finished, and look if first WaitFor was reached, then if it was passed etc.. First time your code stops - that's where the problem is.
Perhaps there's more than one $ returned before command prompt is displayed?