| View previous topic :: View next topic |
| Author |
Message |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Fri Dec 12, 2008 10:04 am Post subject: run one script on srv with command |
|
|
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 |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Fri Dec 12, 2008 10:49 am Post subject: |
|
|
| 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
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 |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Fri Dec 12, 2008 12:37 pm Post subject: |
|
|
| working.. big thnks :> |
|
| Back to top |
|
 |
|