X-Git-Url: http://git.harvie.cz/?p=mirrors%2Flibpurple-core-answerscripts.git;a=blobdiff_plain;f=purple%2Fanswerscripts.d%2F10-menu.pl;fp=purple%2Fanswerscripts.d%2F10-menu.pl;h=d7afa4e14020d4d71d199095f45b09b3acc985ae;hp=0000000000000000000000000000000000000000;hb=8be8249a6d931dd8c89bebb2930cdfe721bba02a;hpb=3971900dcde58c50b85eabf0d4bcf5f20ba1114a diff --git a/purple/answerscripts.d/10-menu.pl b/purple/answerscripts.d/10-menu.pl new file mode 100755 index 0000000..d7afa4e --- /dev/null +++ b/purple/answerscripts.d/10-menu.pl @@ -0,0 +1,16 @@ +#!/usr/bin/env perl +#Just for you to see that you can use almost any language :-) +use strict; +use warnings; +use Switch; + +switch ($ENV{ANSW_MSG}) { + case /^!help$/ { print "What did you expected? A help?! :-P"; } + case /^!ping$/ { print "PONG"; } + case /^!whoami$/ { print "You are: $ENV{ANSW_FROM}"; } + case /^!(reboot|reset|restart|halt)$/ { print "Broadcast message: The system is going down for reboot NOW !!"; } + case /^!google/ { print "UTFG Yourself: http://google.com/"; } + case /^!uptime$/ { print qx{uptime}; } + case /^!date$/ { print qx{date}; } + case /^!dmesg$/ { print qx{ dmesg | tail -n 5 | tr '\n' '^' } } +}