Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

clidocs

Lars Kellogg-Stedman edited this page Feb 27, 2011 · 7 revisions

Command line utilities

This page presents an overview of the command line tools distributed with python-ftn_. For detailed descriptions of the available options for each command, see the Python documentation. For example:

$ pydoc fidonet.apps.scanmsg

Message manipulation

ftn-scanmsg

The ftn-scanmsg command displays header information from FTS-0001 *.msg files (in either the "on disk" or "packed" formats), and optionally will display the message body.

Example usage:

$ ftn-scanmsg tests/sample.msg
From: Lars @ 322/761
To: Someone Else @ 99/99
Date: 25 Feb 11  21:57:27
Subject: This is a sample message.
Flags:

ftn-querymsg

The ftn-querymsg command is used to extract header information from FTS-0001 *.msg files. It is meant to be used to assist in writing shell scripts that interact with Fidonet style messages.

Example usage:

$ ftn-querymsg -q origNet tests/sample.msg
322

$ ftn-querymsg --qf '%(fromUsername)s -> %(toUsername)s' tests/sample.msg
Lars -> Someone Else

ftn-editmsg

The ftn-editmsg command edits the data contained in a FTS-0001 message header.

Example usage:

$ cp tests/sample.msg work.msg
$ ftn-scanmsg work.msg
From: Lars @ 322/761
To: Someone Else @ 99/99
Date: 25 Feb 11  21:57:27
Subject: This is a sample message.
Flags:
$ ftn-editmsg -t 'The Chief' -f 'The Deputy' -s 'Testing' -d 100/100  work.msg
$ ftn-scanmsg work.msg
From: The Deputy @ 322/761
To: The Chief @ 100/100
Date: 25 Feb 11  21:57:27
Subject: Testing
Flags:

ftn-makemsg

The ftn-makemsg generates an FTS-0001 style message on stdout. By default it creats "packed" messages, you can create "on disk" format messages by padding the --disk option. ftn-makemsg reads a message body on stdin.

Example usage:

$ echo "This is a test." | ftn-makemsg \
    --from 'Lars' \
    --to 'Someone' \
    --orig 1:322/761 \
    --dest 99:99/99 \
    --subject "An exciting subject" \
    --flag killSent \
    --flag private > new.msg
$ ftn-scanmsg new.msg
From: Lars @ 322/761To: Someone @ 99/99
Date: 26 Feb 11  21:37:12
Subject: An exciting subject
Flags: KILLSENT PRIVATE

Packet manipulation

ftn-scanpkt ftn-querypkt ftn-editpk ftn-pack ftn-unpack

Nodelist manipulation

ftn-indexnl

The ftn-indexnl command parses an FTS-5000 nodelist and populates a SQLite database. The default location of the nodelist is read from your fidonet.cfg file.

Example usage:

$ ftn-indexnl -V
2011-02-26 21:45:02 indexnl:INFO [70048] indexing nodelist/nodelist.049

Once the index is complete, you can use the sqlite command line tool to query the nodelist database. For example, to find all nodes in 1:322/* that accept BinkD connections:

sqlite> select address,name,sysop from nodes join flags
   ...> on (parent_id = nodes.id)
   ...> where zone=1 and net=322 and flag_name='IBN';
1:322/320|Lost_Crypt|Rick_Svyzek
1:322/759|The_Zone|Roger_Shays
1:322/761|Somebbs|Lars_Kellogg-stedman
1:322/762|The_American_Connection_BBS|Craig_Gagner
1:322/767|EOS_2|Nikita_Sarychev

To find the mail hub for systems in 1:154/*:

sqlite> select address from nodes where zone=1 and net=154 and kw='Hub'; 1:154/15

Clone this wiki locally