Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: sending commands to batch

$
0
0
I use renci.sshnet to run alot of commands on ubuntuo 8.4 and 12.04, and i have had some issues with the shell hanging. To get around this issue i have started echoing commands into batch.

Here is a oneliner example of forcing a reboot -f ( which alone hangs the terminal )

string cmd = @"echo Password | sudo -S echo 'sleep 2s && sudo reboot -f' | batch";

I hope this can be useful for others people like me who are not linux guru's.

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>