View Full Version : add cmds to ioGui2 menus

10-28-2004, 11:31 AM
I've added a few other custom commands to ioFTPD, like banning, which I'd like to add to the ioGui2 menus:
%(clientip) seems to return the hostname, what can I use to return the ip address? %(ipaddr) didn't work :( neither did %(ip) , and can I just add my own commands like:

menu_activity = Ban %(ipaddr) | $ftp SITE ADDBAN %(ipaddr) ?

also, can I pipe commands like,

menu_activity = kick/ban %(cid)@%(ipaddr) | $ftp SITE ADDBAN %(ipaddr) | $ftp site kill %(cid)

and can I do all this without modifying too much else?
Thanks, and thanks for ioGui2!

10-28-2004, 04:02 PM
%(clientip) is indeed the client's hostname, will be fixed in next version, cookies will be %(clienthost) and %(clientip)

performing multiple ftp commands in one menu item isn't possible at the moment, but u can do a little workaround through settings.ini:
enter in a texteditor
menu_activity = kick/ban %(cid)@%(ipaddr) | $ftp SITE ADDBAN %(ipaddr)x$ftp site kill %(cid)
now open settings.ini in a hexeditor, and replace the x with the hexadecimal value 0A (= '\n' = newline)
ioGui2 will send the entire string as a single command, ioFTPD will split the string at the position of the newline, performing both commands.

10-28-2004, 10:43 PM
Veeeery tricky!! <grin>
Now my only problem is the hostname/IP thing, since unfortunately all the ban scripts I've seen on the site use the IP and not the hostname. How can I return the IP? Or is that not possible until the next version because there are a limited number of cookies coded into the .exe? 8{
Thanks for your replies.

10-29-2004, 11:19 AM
try this (http://www.ioftpd.com/scripts/script.php?id=27)

10-30-2004, 12:32 AM
THX (--)(__)

10-30-2004, 03:16 AM
Rear ADDiCT,
thank you first times for your singular ioGui 2,0,6: -)
I bad still another function, would be very nice if you this go around to add could: In menu "activity" IP ban function

for example: ban IP <> for <X> minutes, hours...
Would be very grateful if you this function immediately add could.

thanks :banana:

10-30-2004, 05:15 AM
ioFTPD doesn't have a built-in command to add an IP to the ban list, only to view the banlist (SITE BANS LIST) and to remove a banned ip (SITE BANS REMOVE
This means, if u want to "manage" a list of banned ip's, u will need an external script anyway. I don't see any reason why i should implement this in ioGui, if there already is such a script (http://www.ioftpd.com/board/showthread.php?s=&threadid=2535).

Install that script, and edit settings.ini
menu_activity = Ban ip %(clientip) | SITE ADDBAN %(clientip)

10-30-2004, 07:17 AM
AWESOME!! Thank you so MUCH!!

01-25-2005, 08:24 AM
I am still trying to perform multiple commands with a single click in ioGUI, and I gave up trying to pipe commands, or use a hex editor as you suggested. Now I am trying to use a batch script instead like this, hoping the parameters are passed to the bat:

menu_activity = Kick-Ban %(user) | $ftp SITE KICKBAN %(clientip) %(cid)

in [FTP_Custom_Commands]
KICKBAN = %EXEC ..\scripts\KickBan\KickBan.bat
ADDBAN = TCL ..\scripts\ioB\ioB.tcl addban

and my kickban.bat
@echo off
echo Banning %1(clientIP) and killing %2(cid)
echo !ADDBAN %1(clientIP) somereason
echo !kill %2(cid)
exit 0

it does return the echoed text, and "command successful", but nothing happens, maybe because I am not passing the parameters correctly? What am I doing wrong?