View Single Post
Old 11-03-2003, 08:20 AM  
darkone
Disabled
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

here's the full script that I used to test functions:

#iputs "$args"

iputs "Opening userfile"

if { [userfile open "darkone"] == 0 } {
iputs "Open!"
iputs [userfile bin2ascii]
}

## Fetch who list
if { [client who init "UID" "VIRTUALPATH" "CID" "TRANSFERSIZE"] == 0 } {
while { 1 } {
set data [client who fetch]
if { "$data" == "" } {
break
}
iputs -nobuffer "Uid: [lindex $data 0] Path: [lindex $data 1] Transfered: [lindex $data 3]"
}
}

## Resolve paths
set pwd "/mnt/d-drive"
iputs "Resolved $pwd to [resolve pwd $pwd]"
if { [mountfile open "d:/ioFTPD/etc/default.vfs"] == 0 } {
iputs "Mountfile read!"
iputs "Resolved $pwd to [resolve pwd $pwd]"
}

## Create user, rename it & finally delete (same commands apply to groups)
set name "lamer"
set newuid [user create "$name"]
if { $newuid >= 0 } {
iputs "Created user $name"
if { [user rename "$name" "$name\_delete"] == 0 } {
iputs "Successfully renamed user $name to $name\_delete"
set name "$name\_delete"
} else {
iputs "Failed to rename $name to $name\_delete"
}
if { [user delete "$name"] == 0 } {
iputs "User $name is history!"
} else {
iputs "Could not delete user $name..."
}
}

## Show hashed string
iputs "Hash for \"dungeon\": [sha1 "dungeon"]"

## Create timer, interval 5000ms/5s
if { [timer 5000 "TCL ../scripts/tcltimer.itcl $uid"] == 0 } {
iputs "Timer created! It kills user with uid $uid in 5seconds..."
}

#client kill clientid [lindex $data 2]

set ioerror 0
darkone is offline