egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Basic Respond to Trigger Script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
jekimbal
Voice


Joined: 13 Dec 2007
Posts: 6

PostPosted: Thu Dec 20, 2007 11:49 am    Post subject: Basic Respond to Trigger Script Reply with quote

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
View user's profile Send private message
jekimbal
Voice


Joined: 13 Dec 2007
Posts: 6

PostPosted: Thu Dec 20, 2007 12:09 pm    Post subject: . Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Dec 20, 2007 2:59 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber