Commit | Line | Data |
---|---|---|
b44d7b66 H |
1 | #!/usr/bin/env perl |
2 | #Just for you to see that you can use almost any language :-) | |
3 | use strict; | |
4 | use warnings; | |
5 | use Switch; | |
6 | ||
c5863c50 | 7 | switch ($ENV{ANSW_MSG}) { |
8ddbf94e | 8 | case /^!help$/ { print qx{ grep -o 'case /[^\$/]*' "$0" | grep -o '!.*' | tr '\n' ',' }; } |
b44d7b66 | 9 | case /^!ping$/ { print "PONG"; } |
c5863c50 | 10 | case /^!whoami$/ { print "You are: $ENV{ANSW_FROM}"; } |
8ddbf94e | 11 | case /^!status$/ { print "[$ENV{ANSW_STATUS}] $ENV{ANSW_STATUS_MSG}"; } |
b44d7b66 H |
12 | case /^!(reboot|reset|restart|halt)$/ { print "Broadcast message: The system is going down for reboot NOW !!"; } |
13 | case /^!google/ { print "UTFG Yourself: http://google.com/"; } | |
14 | case /^!uptime$/ { print qx{uptime}; } | |
15 | case /^!date$/ { print qx{date}; } | |
8ddbf94e | 16 | case /^!dmesg$/ { print qx{ dmesg | tail -n 5 | tr '\n' '\t' } } |
b44d7b66 | 17 | } |