home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: SysTools
/
SysTools.zip
/
cimon096.zip
/
README
< prev
next >
Wrap
Text File
|
2002-04-05
|
5KB
|
152 lines
cimon Apr 05 2002
-------------------------------------------------------------------------
This program provides a command line interface to the "floppy-isdn4linux"
(http://www.fli4l.de) imon daemon, and was written to talk to imond from
within UNIX shell scripts. It has been tested against version 1.5.2 of
imond only, and is placed in the public domain.
Direct comments to Rene Herman <rene.herman@mail.com>.
Please note that if your question is actually about imond (such as which
commands or queries to send to solve a particular problem) the imond
documentation is far more likely to be helpful than I am, seeing as how
I don't actually (actively) use fli4l myself. Also see the bit below
about sending the `help' command to imond to have it spit back a short
usage screen at you. However, any and all comments about cimon itself
are welcome at the address above.
Installing
-------------------------------------------------------------------------
To compile this program on Linux, simply typing
make
should be all you need. Compilation should proceed without warnings
against both libc5 and libc6 (tested with libc-5.4.46 and glibc-2.2.3).
When `make' finishes successfully, install the generated executable by
simply copying it into a directory on your path:
cp cimon /usr/local/bin/
/usr/local/bin/ or ~/bin/ could be good choices.
Although largely untested, it is expected to compile cleanly on other
UNIX and UNIX-like platforms as well. You may have to override the
Makefile's choice of compiler (gcc) and CFLAGS though. To do so, edit
Makefile or supply alternates on the make command line. For example:
make CC=cc CFLAGS="-O"
Please refer to README.OS2 for compilation on OS/2.
Using
-------------------------------------------------------------------------
Type `cimon -h' for a short usage message:
Usage: cimon [OPTION]... HOST [COMMAND]
Communicate with the IMON daemon at HOST.
-f FILE read commands from file FILE
-p PASSWORD login with password PASSWORD
-t PORT connect to HOST at port number PORT
-h display this help and exit
-V output version information and exit
When COMMAND is absent and FILE is absent or - read commands from stdin.
You can provide cimon with commands to send to imond in three ways:
- having it read commands from stdin
- having it read commands from a file
- providing commands on the command line
The first method is used when you provide no arguments to cimon other
than the mandatory HOST argument. As an example, assuming your imond host
is called `router', the command:
cimon router
lets you enter into an interactive session with imond not unlike the one
you would have entered had you typed `telnet router 5000'. Type commands
and hit <enter> to send them to the remote imond (give the `help' command
to have imond present you with a help/usage screen). Ctrl-D will get you
out again (the `quit' command will be send). Alternatively, typing
quit<enter>
yourself should get you out by instructing the remote imond to close the
connection. Do not provide the `quit' command yourself during normal
operation though; cimon will consider the broken connection an error.
Obviously, all methods the shell provides to redirect stdin are at your
disposal in this mode:
echo channels | cimon router
cimon router <<EOF
>channels
>EOF
cimon router < commands.file
This last example is an alternative for the second method of providing
cimon with commands - through the use of a command file:
cimon -f commands.file router
This program honours the tradition of letting `-' in an input file
option context denote stdin.
The third method, providing commands on the command line, is best suited
to single commands:
cimon router channels
cimon router status 1
Note that you can provide more than one command on the command line by
embedding literal newlines:
cimon router channels$'\n'status 1$'\n'status 2
but if you need to send more than one command, its probably best to use
a command file or redirect from a here-document:
cimon router <<EOF
>channels
>status 1
>status 2
EOF
If you have setup imond to require a password before accepting commands,
supply it with the `-p PASSWORD' option. It is your responsibility to
supply the admin password if you're sending a command that requires admin
privileges. Use `-t PORT' to change the TCP port from the default (5000),
`-h' to have cimon produce the usage message included above, and `-V' to
have it output its version.
One further example
-------------------------------------------------------------------------
This program was written specifically to check on the online status of a
fli4l router. The following shell script fragment demonstrates how this
can be accomplished. If it's called just when the router is dialing out,
it will pause for a second and then try again.
while STATUS=`cimon router status 1` && [ "$STATUS" = "OK Calling" ]; do
sleep 1
done
if [ "$STATUS" = "OK Online" ]; then
echo Router is online
else
echo Router is not online
fi
-------------------------------------------------------------------------