Go Back   FlashFXP Forums > >

Programming Need help with C/C++/Delphi? Ask here and make us all laugh.

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 12-07-2005, 10:11 PM   #1
EwarWoo
Senior Member
FlashFXP Registered User
ioFTPD Registered User
 
Join Date: Oct 2002
Posts: 462
Default Anyone help me with TCL please?

I'm trying to bodge together a little bot script, however having never used TCL before I'm struggling and I'm sure my syntax is completely whacked. I'm trying to bodge a script to restart ioFTPD if its down:

Code:
bind pub o|o !start proc_iostart

proc proc_iostart {nick uhost hand chan args} {
	global binary announce
	putquick "PRIVMSG $chan :-\[START\] + Attempting to start ioFTPD"
	cd c:/FTP-SERVER/ioFTPD/system
	exec pslist ioFTPD > nul
	If 
		(ERRORLEVEL 1) {
			exec ioFTPD.exe 
			putquick "PRIVMSG $chan :-\[START\] + ioFTPD started"
	}
	Else	
		{
		putquick "PRIVMSG $chan :-\[START\] + ioFTPD already running"
	}
	cd c:/FTP-SERVER/sitebot/
}
I currently get an error stating if is an invalid command.
I was wanting to just run a bat file from here and it was working however it didn't exit correctly so froze the bot so I'm trying to insert it directly into the script.

Code:
@echo off
CD d:\path\to\ioFTPD\system
pslist ioFTPD > nul
IF ERRORLEVEL 1 GOTO restart
GOTO END

:RESTART
CD d:\path\to\ioFTPD\system
start ioFTPD.exe

:END
EwarWoo is offline  
 

Tags
ioftpd, putquick, restart, start, [start]


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:34 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)