Project

General

Profile

Feature #641

Irccdctl commands for rule editing

Added by David Demelier almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
irccdctl
Target version:
Start date:
03/27/2017
Due date:
% Done:

100%

Estimated time:
4.00 h
Spent time:
MFD after:
MFD revision:
Branch:
default
Bookmark:
@
Platform:

Description

Add a set of irccdctl commands to allow editing rules while irccd is running.

Listing

List all rules.

Synopsis

$ irccdctl rule-list [-f, --format json|native]

Example

$ irccdctl rule-list
rule:     0
servers:  server1 server2
channels: #chan1 #chan2
events:   onQuery onMessage
plugins:  p1 p2
action:   drop

rule:     1
servers:  server1
channels: #chan1 #chan2
events:   onInvite
plugins:  p1 p2
action:   drop

Note: indent the same number of spaces as irccdctl watch.

With optional JSON format (check option name in irccdctl watch)

$ irccdctl rule-list -f json
[
    {
        "servers": [ "server1", "server2" ],
        "channels": [ "#chan1", "#chan2" ],
        "events": [ "onQuery", "onMessage" ],
        "plugins": [ "p1", "p2" ],
        "action": "drop" 
    },

    {
        "servers": [ "server1" ],
        "channels": [ "#chan1", "#chan2" ],
        "events": [ "onInvite" ],
        "plugins": [ "p1", "p2" ],
        "action": "drop" 
    }
]

Editing and adding

Add or edit existing rules.

Synopsis

$ irccdctl rule-edit [options] index
$ irccdctl rule-add [options] index

Options

  • -S, --remove-server: remove a server,
  • -s, --add-server: add a server,
  • -C, --remove-channel: remove a channel,
  • -c, --add-channel: add a channel,
  • -E, --remove-event: remove a event,
  • -e, --add-event: add a event,
  • -P, --remove-plugin: remove a plugin,
  • -p, --add-plugin: add a plugin,
  • -a, --action: select action drop or accept (default: accept).

Note: for rule-add the rule will be added before index.

Example

$ irccdctl rule-edit -s freenode -c #staff -p hangman -a drop

Removing

Remove existing rule.

Synopsis

$ irccdctl rule-remove index

Example

$ irccdctl rule-remove 4

View

Like list but only show a specific rule. Can use JSON as well.

Synopsis

$ irccdctl rule-info [-f, --format json|native] index

Example

$ irccdctl rule-info 4
rule:     4
servers:  server1 server2
channels: #chan1 #chan2
events:   onQuery onMessage
plugins:  p1 p2
action:   drop

And with JSON

$ irccdctl rule-info -f json 4
{
    "servers": [ "server1" ],
    "channels": [ "#chan1", "#chan2" ],
    "events": [ "onInvite" ],
    "plugins": [ "p1", "p2" ],
    "action": "drop" 
}

Moving

Move a rule somewhere else.

Synopsis

$ irccdctl rule-move origin destination

Example

$ irccdctl rule-move 4 2

History

#1

Updated by David Demelier over 2 years ago

  • Description updated (diff)
#2

Updated by David Demelier over 2 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Resolved
#3

Updated by David Demelier over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF