Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Feb 9th, 2010 | Syntax: None | Size: 16.29 KB | Hits: 30 | Expires: Never
Copy text to clipboard
  1. # shroudBNC - an object-oriented framework for IRC
  2. # Copyright (C) 2005 Gunnar Beutner
  3. #
  4. # Modified By Worrum
  5. #
  6. # * added password restriction
  7. # * added /sbnc vhostwho command, to give userstatistic per vhost
  8. # * fixed vhosts with limit 0 (private) being visible to admins
  9. # * fixed vhosts/vhost selecting looking at the _actual_ connection
  10. #   which are in use, and not just given with /sbnc set (and thus not actually used yet)
  11. # * fixed proper _free_ vhost selection on usercreate (it doesnt pick 0 limit, or passworded
  12. #   anymore) if all vhosts are full, vhost '0' is set, disallowing the user to connect.
  13. #
  14. # This program is free software; you can redistribute it and/or
  15. # modify it under the terms of the GNU General Public License
  16. # as published by the Free Software Foundation; either version 2
  17. # of the License, or (at your option) any later version.
  18. #
  19. # This program is distributed in the hope that it will be useful,
  20. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. # GNU General Public License for more details.
  23. #
  24. # You should have received a copy of the GNU General Public License
  25. # along with this program; if not, write to the Free Software
  26. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  27.  
  28. internalbind command vhost:command
  29. internalbind usrcreate vhost:newuser
  30.  
  31. # Give regular user access to any vhost being not 0 in limit password is default set to root (changable through /sbnc vhostoverride)
  32. if {[bncgetglobaltag vhost.override] == ""} {
  33.         bncsetglobaltag vhost.override "root"
  34. }
  35.  
  36.  
  37. proc vhost:host2ip {host} {
  38.         set vhosts [bncgetglobaltag vhosts]
  39.  
  40.         if {[lsearch -exact [info procs] "vhost_hack:getadditionalvhosts"] != -1} {
  41.                 set vhosts [concat $vhosts [vhost_hack:getadditionalvhosts]]
  42.         }
  43.  
  44.         foreach vhost $vhosts {
  45.                 if {[string equal -nocase [lindex $vhost 2] $host]} {
  46.                         return [lindex $vhost 0]
  47.                 }
  48.         }
  49.  
  50.         return $host
  51. }
  52.  
  53. proc vhost:ip2host {ip} {
  54.         set vhosts [bncgetglobaltag vhosts]
  55.         set ip [vhost:expandipv6 $ip]
  56.         if {[lsearch -exact [info procs] "vhost_hack:getadditionalvhosts"] != -1} {
  57.                 set vhosts [concat $vhosts [vhost_hack:getadditionalvhosts]]
  58.         }
  59.  
  60.         foreach vhost $vhosts {
  61.                 if {[string equal -nocase [lindex $vhost 0] $ip]} {
  62.                         return [lindex $vhost 2]
  63.                 }
  64.         }
  65.  
  66.         return $host
  67. }
  68.  
  69. proc vhost:countvhost {ip} {
  70.         set count 0
  71.  
  72.         set ip [vhost:host2ip $ip]
  73.  
  74.         foreach user [bncuserlist] {
  75.                 if {![getbncuser $user hasserver]} {
  76.                         if {[string equal -nocase [getbncuser $user vhost] $ip]} {
  77.                                 incr count
  78.                         }
  79.                 } else  {
  80.                         if {[string equal -nocase [vhost:expandipv6 [getbncuser $user localip]] $ip]} {
  81.                                 incr count
  82.                         }
  83.                 }
  84.         }
  85.  
  86.         return $count
  87. }
  88.  
  89. proc vhost:vhostusers {ip} {
  90.         set count ""
  91.         set listcount ""
  92.         set ip [vhost:host2ip $ip]
  93.  
  94.         foreach user [lsort [bncuserlist]] {
  95.                 if {![getbncuser $user hasserver]} {
  96.                         if {[string equal -nocase [getbncuser $user vhost] $ip]} {
  97.                                 lappend count $user
  98.                         }
  99.                 } else  {
  100.                         if {[string equal -nocase [vhost:expandipv6 [getbncuser $user localip]] $ip]} {
  101.                                 lappend count $user
  102.                         }
  103.                 }
  104.                 if {([llength $count] == 10)} {
  105.                         lappend listcount $count
  106.                         set count ""
  107.                 }
  108.         }
  109.         if {([llength $count] > 0)} {
  110.                 lappend listcount $count
  111.         }
  112.         if {$listcount == ""} { set listcount "None"    }
  113.         return $listcount
  114. }
  115.  
  116. proc vhost:expandipv6 {ip} {
  117.         if {[string match *:* $ip] == 0} { return $ip }
  118.         set newip ""
  119.         set ip [string map {{::} {:ZZZZ:}} $ip]
  120.         foreach x [split $ip {:}] {
  121.                 lappend newip [string range "0000$x" end-3 end]
  122.         }
  123.         set newip [join $newip {:}]
  124.         set i 0
  125.         while {[llength [split $newip {:}]] < 8} {
  126.                 incr i
  127.                 if {$i > 10} { return 0 }
  128.                 set newip [string map {{:ZZZZ:} {:0000:ZZZZ:}} $newip]
  129.         }
  130.         return [string map {{Z} {0}} $newip]
  131. }
  132.  
  133. proc vhost:getlimit {ip} {
  134.         set vhosts [bncgetglobaltag vhosts]
  135.         set ip [vhost:host2ip $ip]
  136.  
  137.         if {[lsearch -exact [info procs] "vhost_hack:getadditionalvhosts"] != -1} {
  138.                 set vhosts [concat $vhosts [vhost_hack:getadditionalvhosts]]
  139.         }
  140.  
  141.         set res [lsearch -inline $vhosts "$ip *"]
  142.  
  143.         if {$res != ""} {
  144.                 return [lindex $res 1]
  145.         } else {
  146.                 return -1
  147.         }
  148. }
  149.  
  150. proc vhost:getpassword {ip} {
  151.         set vhosts [bncgetglobaltag vhosts]
  152.         set ip [vhost:host2ip $ip]
  153.  
  154.         if {[lsearch -exact [info procs] "vhost_hack:getadditionalvhosts"] != -1} {
  155.                 set vhosts [concat $vhosts [vhost_hack:getadditionalvhosts]]
  156.         }
  157.  
  158.         set res [lsearch -inline $vhosts "$ip *"]
  159.  
  160.         if {$res != ""} {
  161.                 return [lindex $res 3]
  162.         } else {
  163.                 return 0
  164.         }
  165. }
  166.  
  167.  
  168. proc vhost:isip {host} {
  169.         return [regexp -nocase -- {^(^(([0-9A-F]{1,4}(((:[0-9A-F]{1,4}){5}::[0-9A-F]{1,4})|((:[0-9A-F]{1,4}){4}::[0-9A-F]{1,4}(:[0-9A-F]{1,4}){0,1})|((:[0-9A-F]{1,4}){3}::[0-9A-F]{1,4}(:[0-9A-F]{1,4}){0,2})|((:[0-9A-F]{1,4}){2}::[0-9A-F]{1,4}(:[0-9A-F]{1,4}){0,3})|(:[0-9A-F]{1,4}::[0-9A-F]{1,4}(:[0-9A-F]{1,4}){0,4})|(::[0-9A-F]{1,4}(:[0-9A-F]{1,4}){0,5})|(:[0-9A-F]{1,4}){7}))$|^(::[0-9A-F]{1,4}(:[0-9A-F]{1,4}){0,6})$)|^::$)|^((([0-9A-F]{1,4}(((:[0-9A-F]{1,4}){3}::([0-9A-F]{1,4}){1})|((:[0-9A-F]{1,4}){2}::[0-9A-F]{1,4}(:[0-9A-F]{1,4}){0,1})|((:[0-9A-F]{1,4}){1}::[0-9A-F]{1,4}(:[0-9A-F]{1,4}){0,2})|(::[0-9A-F]{1,4}(:[0-9A-F]{1,4}){0,3})|((:[0-9A-F]{1,4}){0,5})))|([:]{2}[0-9A-F]{1,4}(:[0-9A-F]{1,4}){0,4})):|(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{0,2})\.){3}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{0,2})$$} $host]
  170. }
  171.  
  172. proc vhost:command {client parameters} {
  173.         if {![getbncuser $client admin] && [string equal -nocase [lindex $parameters 0] "set"] && [string equal -nocase [lindex $parameters 1] "vhost"]} {
  174.                 if {[lsearch -exact [info commands] "lock:islocked"] != -1} {
  175.                         if {![string equal [lock:islocked [getctx] "vhost"] "0"]} { return }
  176.                 }
  177.                 if {[lrange $parameters 2 end] == ""} {
  178.                         bncreply "Syntax: set vhost <ip> \[<password>\]"
  179.                         haltoutput
  180.                         return
  181.                 }
  182.                 if {![vhost:isip [lindex $parameters 2]]} {
  183.                         bncreply "You have to specify a valid IP address."
  184.  
  185.                         haltoutput
  186.                         return
  187.                 }
  188.                 set limit [vhost:getlimit [lindex $parameters 2]]
  189.  
  190.                 if {$limit <= 0 } {
  191.                         bncreply "Sorry, you may not use this IP address/hostname."
  192.  
  193.                         haltoutput
  194.                         return
  195.                 } elseif {[vhost:countvhost [lindex $parameters 2]] >= $limit} {
  196.                         bncreply "Sorry, the IP address [lindex $parameters 2] is already being used by [vhost:countvhost [lindex $parameters 2]] users. A maximum number of [vhost:getlimit [lindex $parameters 2]] users may use this IP address."
  197.  
  198.                         haltoutput
  199.                         return
  200.                 }
  201.                 if {!([vhost:getpassword [lindex $parameters 2]] == "")} {
  202.                         if {([lindex $parameters 3] == "")} {
  203.                                 haltoutput
  204.                                 bncreply "This vhost requires a password, use set vhost <ip> <password>"
  205.                                 return
  206.                         }
  207.                         if {!([vhost:getpassword [lindex $parameters 2]] == [lindex $parameters 3]) && !([bncgetglobaltag vhost.override] == [lindex $parameters 3])} {
  208.                                 haltoutput
  209.                                 bncreply "Sorry, the entered password is incorrect"
  210.                                 return
  211.                         }
  212.                 }
  213.         }
  214.  
  215.         set vhosts [bncgetglobaltag vhosts]
  216.  
  217.         if {[lsearch -exact [info procs] "vhost_hack:getadditionalvhosts"] != -1} {
  218.                 set vhosts [concat $vhosts [vhost_hack:getadditionalvhosts]]
  219.         }
  220.  
  221.         if {[string equal -nocase [lindex $parameters 0] "vhosts"]} {
  222.                 foreach vhost $vhosts {
  223.                         if {[getbncuser $client admin]} {
  224.                                 if {!([vhost:getpassword [lindex $vhost 0]] == "")} {
  225.                                         bncreply "[lindex $vhost 0] ([lindex $vhost 2]) [vhost:countvhost [lindex $vhost 0]]/[vhost:getlimit [lindex $vhost 0]] connections \[password required: [vhost:getpassword [lindex $vhost 0]]\]"
  226.                                 } else  {
  227.                                         bncreply "[lindex $vhost 0] ([lindex $vhost 2]) [vhost:countvhost [lindex $vhost 0]]/[vhost:getlimit [lindex $vhost 0]] connections"
  228.                                 }
  229.                         } elseif {[vhost:getlimit [lindex $vhost 0]] > 0} {
  230.                                 if {[vhost:countvhost [lindex $vhost 0]] >= [vhost:getlimit [lindex $vhost 0]]} {
  231.                                         set status "full"
  232.                                 } else {
  233.                                         set status "not full"
  234.                                 }
  235.                                 if {!([vhost:getpassword [lindex $vhost 0]] == "")} {
  236.                                         lappend status "\[passworded\]"
  237.                                 }
  238.                                 bncreply "[lindex $vhost 0] ([lindex $vhost 2]) \[[join $status]\]"
  239.                         }
  240.                 }
  241.  
  242.                 bncreply "-- End of VHOSTS."
  243.  
  244.                 haltoutput
  245.         }
  246.         if {[string equal -nocase [lindex $parameters 0] "vhostwho"] && [getbncuser $client admin]} {
  247.                 if {[lindex $parameters 1] == ""} {
  248.                         foreach vhost $vhosts {
  249.                                 if {[vhost:getlimit [lindex $vhost 0]] > -1} {
  250.                                         bncreply "[lindex $vhost 0] ([lindex $vhost 2]) usage: ([vhost:countvhost [lindex $vhost 0]]/[vhost:getlimit [lindex $vhost 0]])"
  251.                                         set userlist [vhost:vhostusers [lindex $vhost 0]]
  252.                                         foreach group $userlist { bncreply "users: $group" }
  253.                                 }
  254.                         }
  255.                         bncreply "-- End of VHOSTS."
  256.                         haltoutput
  257.                         return
  258.                 } else {
  259.                         set vhost [lindex $parameters 1]
  260.                         if {[vhost:getlimit $vhost] == "-1"} { bncreply "No such vhost." ; haltoutput ; return }
  261.                         set vhost [lsearch -inline $vhosts "$vhost *"]
  262.                         bncreply "[lindex $vhost 0] ([lindex $vhost 2]) usage: ([vhost:countvhost [lindex $vhost 0]]/[vhost:getlimit [lindex $vhost 0]])"
  263.                         set userlist [vhost:vhostusers [lindex $vhost 0]]
  264.                         foreach group $userlist { bncreply "users: $group" }
  265.                         haltoutput
  266.                 }
  267.         }
  268.         if {[getbncuser [getctx] admin] && [string equal -nocase [lindex $parameters 0] "addvhost"]} {
  269.                 set ip [lindex $parameters 1]
  270.                 set limit [lindex $parameters 2]
  271.                 set host [lindex $parameters 3]
  272.                 set password [lindex $parameters 4]
  273.  
  274.                 if {$host == ""} {
  275.                         bncreply "Syntax: ADDVHOST <ip> <limit> <host> \[password\]"
  276.  
  277.                         haltoutput
  278.                         return
  279.                 }
  280.  
  281.                 if {![vhost:isip $ip]} {
  282.                         bncreply "You did not specify a valid IP address."
  283.  
  284.                         haltoutput
  285.                         return
  286.                 }
  287.  
  288.                 if {![string is integer $limit]} {
  289.                         bncreply "You did not specify a valid limit."
  290.  
  291.                         haltoutput
  292.                         return
  293.                 }
  294.  
  295.                 if {[catch [list vhost:addvhost $ip $limit $host $password] error]} {
  296.                         bncreply $error
  297.                 } else {
  298.                         bncreply "Done."
  299.                 }
  300.  
  301.                 haltoutput
  302.         }
  303.  
  304.         if {[getbncuser [getctx] admin] && [string equal -nocase [lindex $parameters 0] "changevhost"]} {
  305.                 set ip [lindex $parameters 1]
  306.                 set limit [lindex $parameters 2]
  307.                 set host [lindex $parameters 3]
  308.                 set password [lindex $parameters 4]
  309.  
  310.                 if {$host == ""} {
  311.                         bncreply "Syntax: CHANGEVHOST <ip> <limit> <host> \[password\]"
  312.  
  313.                         haltoutput
  314.                         return
  315.                 }
  316.  
  317.                 if {![vhost:isip $ip]} {
  318.                         bncreply "You did not specify a valid IP address."
  319.  
  320.                         haltoutput
  321.                         return
  322.                 }
  323.  
  324.                 if {![string is integer $limit]} {
  325.                         bncreply "You did not specify a valid limit."
  326.  
  327.                         haltoutput
  328.                         return
  329.                 }
  330.                 if {[catch [list vhost:delvhost $ip] error]} {
  331.                         bncreply $error
  332.                         haltoutput
  333.                         return
  334.                 }
  335.                 if {[catch [list vhost:addvhost $ip $limit $host $password] error]} {
  336.                         bncreply $error
  337.                 } else {
  338.                         bncreply "Done."
  339.                 }
  340.                 haltoutput
  341.         }
  342.  
  343.         if {[getbncuser [getctx] admin] && [string equal -nocase [lindex $parameters 0] "delvhost"]} {
  344.                 set ip [vhost:host2ip [lindex $parameters 1]]
  345.  
  346.                 if {$ip == ""} {
  347.                         bncreply "Syntax: DELVHOST <ip>"
  348.  
  349.                         haltoutput
  350.                         return
  351.                 }
  352.  
  353.                 if {[catch [list vhost:delvhost $ip] error]} {
  354.                         bncreply $error
  355.                 } else {
  356.                         bncreply "Done."
  357.                 }
  358.  
  359.                 haltoutput
  360.         }
  361.  
  362.         if {[getbncuser [getctx] admin] && [string equal -nocase [lindex $parameters 0] "vhostoverride"]} {
  363.                 if {[lindex $parameters 1] == ""} {
  364.                         bncreply "Syntax: VHOSTOVERRIDE <password>"
  365.                         bncreply "The current password is: [bncgetglobaltag vhost.override]"
  366.  
  367.                         haltoutput
  368.                         return
  369.                 } else  {
  370.                         bncsetglobaltag vhost.override [lindex $parameters 1]
  371.                         bncreply "Done."
  372.                 }
  373.                 haltoutput
  374.         }
  375.  
  376.         if {[string equal -nocase [lindex $parameters 0] "help"]} {
  377.                 if {[getbncuser [getctx] admin]} {
  378.                         bncaddcommand addvhost Vhost "adds a new vhost" "Syntax: addvhost ip limit host \[password\]\nAdds a new vhost."
  379.                         bncaddcommand delvhost Vhost "removes a vhost" "Syntax: delvhost ip\nRemoves a vhost."
  380.                         bncaddcommand vhostoverride Vhost "sets the vhost override password" "Syntax: vhostoverride password \nSets the vhost override password which allows regular users to use any passworded vhost, using this password."
  381.                         bncaddcommand vhostwho Vhost "list vhostusage" "Syntax: vhostwho \[vhost\]\n view the list, or select just a single ip/vhost"
  382.                         bncaddcommand changevhost Vhost "ability to change an existing vhost" "Syntax: changevhost ip limit host \[password\]\nChanges an existing vhost."
  383.                         bncaddcommand vhosts Vhost "lists all available vhosts" "Syntax: vhosts\nDisplays a list of all available virtual vhosts."
  384.                 } else {
  385.                         bncaddcommand vhosts User "lists all available vhosts" "Syntax: vhosts\nDisplays a list of all available virtual vhosts."
  386.                 }
  387.         }
  388. }
  389.  
  390. proc vhost:findip {} {
  391.         set vhosts [bncgetglobaltag vhosts]
  392.  
  393.         if {[lsearch -exact [info procs] "vhost_hack:getadditionalvhosts"] != -1} {
  394.                 set vhosts [concat $vhosts [vhost_hack:getadditionalvhosts]]
  395.         }
  396.         set min 0
  397.         set minip 0
  398.  
  399.         foreach vhost $vhosts {
  400.                 if {([lindex $vhost 1] - [vhost:countvhost [lindex $vhost 0]] > $min) && ([vhost:getpassword [lindex $vhost 0]] == "")} {
  401.                         set min [expr [lindex $vhost 1] - [vhost:countvhost [lindex $vhost 0]]]
  402.                         set minip [lindex $vhost 0]
  403.                 }
  404.         }
  405.         return $minip
  406. }
  407.  
  408. proc vhost:newuser {user} {
  409.         setbncuser $user vhost [vhost:findip]
  410. }
  411.  
  412. proc vhost:addvhost {ip limit host {password ""}} {
  413.         if {[vhost:getlimit $ip] != -1} {
  414.                 return -code error "This vhost has already been added."
  415.         } else {
  416.                 if {[string length $limit] == 0 || ![string is integer $limit] || ($limit <0)} {
  417.                         return -code error "You need to specify a valid limit."
  418.                 }
  419.  
  420.                 if {[string length $ip] == 0} {
  421.                         return -code error "You need to specify a valid IP address."
  422.                 }
  423.  
  424.                 if {[string length $host] == 0} {
  425.                         return -code error "You need to specify a valid hostname."
  426.                 }
  427.  
  428.                 set vhosts [bncgetglobaltag vhosts]
  429.                 lappend vhosts [list $ip $limit $host $password]
  430.                 bncsetglobaltag vhosts $vhosts
  431.         }
  432. }
  433.  
  434. proc vhost:delvhost {ip} {
  435.         set vhosts [bncgetglobaltag vhosts]
  436.         set ip [vhost:host2ip $ip]
  437.         set i 0
  438.         set found 0
  439.  
  440.         while {$i < [llength $vhosts]} {
  441.                 set vhost [lindex $vhosts $i]
  442.  
  443.                 if {[string equal -nocase $ip [lindex $vhost 0]]} {
  444.                         set vhosts [lreplace $vhosts $i $i]
  445.                         set found 1
  446.                         break
  447.                 }
  448.  
  449.                 incr i
  450.         }
  451.  
  452.         if {$found} {
  453.                 bncsetglobaltag vhosts $vhosts
  454.         } else {
  455.                 return -code error "There is no such vhost."
  456.         }
  457. }
  458.  
  459. # iface commands
  460. # +user
  461. # getfreeip
  462. # setvalue vhost
  463. # getvhosts
  464. # +admin
  465. # addvhost ip limit host
  466. # delvhost ip
  467.  
  468. proc iface-vhost:getfreeip {} {
  469.         return [itype_string [vhost:findip]]
  470. }
  471.  
  472. if {[info commands "registerifacecmd"] != ""} {
  473.         registerifacecmd "vhost" "getfreeip" "iface-vhost:getfreeip"
  474. }
  475.  
  476. proc iface-vhost:setvalue {setting value} {
  477.         if {[iface:isoverride]} { return "" }
  478.  
  479.         if {[lsearch -exact [info commands] "lock:islocked"] != -1} {
  480.                 if {![string equal [lock:islocked [getctx] "vhost"] "0"]} { return "" }
  481.         }
  482.  
  483.         if {![getbncuser [getctx] admin] && [string equal -nocase $setting "vhost"]} {
  484.                 set limit [vhost:getlimit $value]
  485.                 if {$limit == 0} { return -code error "You may not use this virtual host." }
  486.  
  487.                 set count [vhost:countvhost $value]
  488.                 if {$count >= $limit} { return -code error "Sorry, the virtual host $ip is already being used by $count users. Please use another virtual host." }
  489.  
  490.                 setbncuser [getctx] vhost $value
  491.         }
  492.  
  493.         return ""
  494. }
  495.  
  496. if {[info commands "registerifacecmd"] != ""} {
  497.         registerifacecmd "vhost" "setvalue" "iface-vhost:setvalue"
  498. }
  499.  
  500. proc iface-vhost:getvhosts {} {
  501.         set result [itype_list_create]
  502.  
  503.         if {[lsearch -exact [info procs] "vhost_hack:getadditionalvhosts"] != -1} {
  504.                 set vhosts [concat $vhosts [vhost_hack:getadditionalvhosts]]
  505.  
  506.                 foreach vhost $vhosts {
  507.                         set vhost_itype [itype_list_strings $vhost]
  508.                         itype_list_insert result $vhost_itype
  509.                 }
  510.         }
  511.  
  512.         set vhosts [bncgetglobaltag vhosts]
  513.  
  514.         foreach vhost $vhosts {
  515.                 set vhost_itype [itype_list_strings_args [lindex $vhost 0] [vhost:countvhost [lindex $vhost 0]] [lindex $vhost 1] [lindex $vhost 2]]
  516.                 itype_list_insert result $vhost_itype
  517.         }
  518.  
  519.         itype_list_end $result
  520.  
  521.         return $result
  522. }
  523.  
  524. if {[info commands "registerifacecmd"] != ""} {
  525.         registerifacecmd "vhost" "getvhosts" "iface-vhost:getvhosts"
  526. }
  527.  
  528. proc iface-vhost:addvhost {ip limit host} {
  529.         vhost:addvhost $ip $limit $host
  530.  
  531.         return ""
  532. }
  533.  
  534. if {[info commands "registerifacecmd"] != ""} {
  535.         registerifacecmd "vhost" "addvhost" "iface-vhost:addvhost" "access:admin"
  536. }
  537.  
  538. proc iface-vhost:delvhost {ip} {
  539.         vhost:delvhost $ip
  540.  
  541.         return ""
  542. }
  543.  
  544. if {[info commands "registerifacecmd"] != ""} {
  545.         registerifacecmd "vhost" "delvhost" "iface-vhost:delvhost" "access:admin"
  546. }