| View previous topic :: View next topic |
| Author |
Message |
jekimbal Voice
Joined: 13 Dec 2007 Posts: 6
|
Posted: Thu Dec 20, 2007 11:49 am Post subject: Basic Respond to Trigger Script |
|
|
I have a few shell commands that id like to execute based on a trigger thats in channel
like someone types
!command it will exectute whatever I want that trigger to execute from a console point and output it to the channel
so this wont be one of them but basically lets say I wanted someone to be able to type
!uname in channel it would execute uname -a on the console machine than output the response to the channel |
|
| Back to top |
|
 |
jekimbal Voice
Joined: 13 Dec 2007 Posts: 6
|
Posted: Thu Dec 20, 2007 12:09 pm Post subject: . |
|
|
Actually found this script on the forum
bind pub o !exec doexec
proc doexec {nick uhost hand chan text} {
puthelp "privmsg $chan :Shell command results:"
foreach line [split [eval exec $text] \n] {
puthelp "privmsg $chan :$line"
}
return 1
}
Now how can I modify this so like !exec will only allow the imput uname -a and no other commands and will only exec uname -a |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Dec 20, 2007 2:59 pm Post subject: |
|
|
| Code: | bind pub o !uname do:uname
proc do:uname {nick uhost hand chan text} {
puthelp "privmsg $chan :Uname -a result:"
foreach line [split [eval exec {uname -a}] \n] {
puthelp "privmsg $chan :$line"
}
return 1
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|