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.

run one script on srv with command

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

run one script on srv with command

Post by ultralord »

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
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Post by tomekk »

Code: Select all

# 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 :)
U should use full paths to files in this script, example some script:

Code: Select all

#!/bin/bash
echo "hello" > hello.txt
after this, hello.txt file will appear in bot directory, this is proper:

Code: Select all

#!/bin/bash
echo "hello" > /somewhere/hello.txt
:>
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

working.. big thnks :>
Post Reply