Skip to content

Instantly share code, notes, and snippets.

@broquaint
Created November 17, 2014 23:23
Show Gist options
  • Save broquaint/b5e7b4d5af8177d9dffb to your computer and use it in GitHub Desktop.
Save broquaint/b5e7b4d5af8177d9dffb to your computer and use it in GitHub Desktop.
A script to get docker booting under wscript.exe (mostly so I don't lose it)
/*
* Wee script to get docker into a working state.
* Once run one should be able to ssh without needing cmd.exe pain.
*/
// Closer to what I expect.
function run(cmd) {
var WshShell = new ActiveXObject("WScript.Shell"),
oExec = WshShell.Exec(cmd);
// Let it run.
while (oExec.Status == 0)
WScript.Sleep(100);
// Get the output.
return oExec.StdOut.ReadLine();
}
function note(msg) {
WScript.StdOut.WriteLine("- "+msg);
}
note( run("boot2docker init") );
if(!run("boot2docker status").match(/running/)) {
run("boot2docker up");
} else {
note("boot2docker already up");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment