Skip to content

Instantly share code, notes, and snippets.

@davidbgk
Forked from brunobord/kill.js
Created April 4, 2013 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidbgk/5309825 to your computer and use it in GitHub Desktop.
Save davidbgk/5309825 to your computer and use it in GitHub Desktop.
/**
* Casper script to restart Alwaysdata processes.
*
* Usage:
* $ casperjs kill.js email@example.com mysecretpassword
*/
var casper = require('casper').create();
casper.start("https://admin.alwaysdata.com/login/");
casper.then(function() {
this.fill('#login form', { email: casper.cli.get(0), password: casper.cli.get(1) }, true);
});
casper.then(function() {
if (this.visible("#loginmsg")) {
this.die('incorrect authentication');
}
});
casper.thenOpen('https://admin.alwaysdata.com/advanced/processes/restart/');
casper.run(function() {
this.echo('processes restarted', 'INFO').exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment