Skip to content

Instantly share code, notes, and snippets.

@brunobord
Created January 30, 2013 23:21
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save brunobord/4678301 to your computer and use it in GitHub Desktop.
Save brunobord/4678301 to your computer and use it in GitHub Desktop.
Casper Script: restart Alwaysdata processes.
/**
* 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