Skip to content

Instantly share code, notes, and snippets.

@berekuk
Created May 1, 2012 16:08
Show Gist options
  • Select an option

  • Save berekuk/2569196 to your computer and use it in GitHub Desktop.

Select an option

Save berekuk/2569196 to your computer and use it in GitHub Desktop.
trivial ubic-web
#!/usr/bin/perl
use Dancer;
use Ubic;
my @commands = qw( start stop status restart try-restart reload force-reload);
post '/:service/:command' => sub {
my $service = param('service');
my $command = param('command');
my $result;
if (grep { $_ eq $command } @commands) {
$result = Ubic->$command($service);
}
else {
$result = Ubic->do_custom_command($service, $command);
}
return "$result";
};
dance;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment