Skip to content

Instantly share code, notes, and snippets.

@fedir
Forked from davidbgk/kill.js
Created June 3, 2013 16:50
Show Gist options
  • Save fedir/5699517 to your computer and use it in GitHub Desktop.
Save fedir/5699517 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