Running omshell from a Shell Script

Martin McCormick martin at dc.cis.okstate.edu
Fri Apr 21 19:03:06 UTC 2006


	I am testing a bash script which is similar to one which
someone posted earlier and it fails unusually under FreeBSD.  It kind
of has the earmarks of a timing issue, but I am not sure.

	Here is a shell script that shuts down a failover peer or
would if it could only connect.

#!/usr/local/bin/bash
# ARG1 Address of DHCP SERVER
#Read in these values from the named file.
. $HOME/keys/omshell.conf
#Set up the here document.
cat << EOF |omshell
server $1
port $MYPORT
key $KEY $SECRET
connect
new control
set state = 00:00:00:02
open
update
EOF 

	What the output looks like:

> > > > dhcpctl_connect: not found
> not connected.
> no open object.
> not connected.
> not connected.
> <STDIN> line 1: unknown token: EOF
EOF 
^
> 

	If I do all those commands manually, it works as expected.

	This may be the wrong group for this question because it
appears to not be a problem with omapi but may be a problem with the
shell script.  It makes one wonder what would happen if one could slow
it down.  Any ideas are appreciated.

Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Network Operations Group


More information about the dhcp-users mailing list