GIT.Harvie.CZ
/
mirrors
/
libpurple-core-answerscripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2462363
)
more fancy menu script example
author
Harvie
<tomas@mudrunka.cz>
Tue, 24 Aug 2010 02:43:02 +0000
(
04:43
+0200)
committer
Harvie
<tomas@mudrunka.cz>
Tue, 24 Aug 2010 02:43:02 +0000
(
04:43
+0200)
purple/answerscripts.d/10-menu.pl
patch
|
blob
|
blame
|
history
diff --git
a/purple/answerscripts.d/10-menu.pl
b/purple/answerscripts.d/10-menu.pl
index d7afa4e14020d4d71d199095f45b09b3acc985ae..40f22b4b2bd57e74daac0c22451bd5d7a75ae750 100755
(executable)
--- a/
purple/answerscripts.d/10-menu.pl
+++ b/
purple/answerscripts.d/10-menu.pl
@@
-5,12
+5,13
@@
use warnings;
use Switch;
switch ($ENV{ANSW_MSG}) {
use Switch;
switch ($ENV{ANSW_MSG}) {
- case /^!help$/ { print
"What did you expected? A help?! :-P"
; }
+ case /^!help$/ { print
qx{ grep -o 'case /[^\$/]*' "$0" | grep -o '!.*' | tr '\n' ',' }
; }
case /^!ping$/ { print "PONG"; }
case /^!whoami$/ { print "You are: $ENV{ANSW_FROM}"; }
case /^!ping$/ { print "PONG"; }
case /^!whoami$/ { print "You are: $ENV{ANSW_FROM}"; }
+ case /^!status$/ { print "[$ENV{ANSW_STATUS}] $ENV{ANSW_STATUS_MSG}"; }
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 /^!(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' '
^
' } }
+ case /^!dmesg$/ { print qx{ dmesg | tail -n 5 | tr '\n' '
\t
' } }
}
}
This page took
0.144444 seconds
and
4
git commands to generate.