This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Basic Respond to Trigger Script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
j
jekimbal
Voice
Posts: 6
Joined: Thu Dec 13, 2007 12:04 pm

Basic Respond to Trigger Script

Post by jekimbal »

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
j
jekimbal
Voice
Posts: 6
Joined: Thu Dec 13, 2007 12:04 pm

.

Post by jekimbal »

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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
}
Post Reply