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 

run one script on srv with command

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


Joined: 06 Nov 2006
Posts: 255

PostPosted: Fri Dec 12, 2008 10:04 am    Post subject: run one script on srv with command Reply with quote

hello can anyone tell me or make for me one tcl script. the job of this script is to run one file..

example:

the location of script for run
/home/ultralord/temp/scriptaki

and if one oper of specific channel press !run then the tcl script runs the scriptaki on previous location.. is that possible?


thanks
Back to top
View user's profile Send private message
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Fri Dec 12, 2008 10:49 am    Post subject: Reply with quote

Code:
# Author: tomekk
# e-mail:  tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html

set script_path "/a/b/c/d/script"

set run_channels {#chan #chan2}

######################################################
bind pub o|o !run run_proc

proc run_proc { nick uhost hand chan arg } {
   global run_channels script_path

   if {[lsearch $run_channels $chan] != -1} {
      catch {exec $script_path}
   }
}

putlog "simple-run.tcl ver 0.1 by tomekk loaded"


try, but watch out Smile
U should use full paths to files in this script, example some script:
Code:

#!/bin/bash
echo "hello" > hello.txt


after this, hello.txt file will appear in bot directory, this is proper:
Code:

#!/bin/bash
echo "hello" > /somewhere/hello.txt


:>
Back to top
View user's profile Send private message Visit poster's website
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Fri Dec 12, 2008 12:37 pm    Post subject: Reply with quote

working.. big thnks :>
Back to top
View user's profile Send private message
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