Running omshell from a Shell Script
Glenn Satchell
Glenn.Satchell at uniq.com.au
Sat Apr 22 08:50:03 UTC 2006
Line 6 is UUOC and could be better written as
omshell << EOF
...
EOF
To debug the script try running bash -x ./scriptname
The -x echoes each command line before running it, and may give some
clues. In particular the value of $HOME may be set to something other
than what you expect when the shell runs. I don't think slowing it down
will make any difference.
regards,
-glenn
>X-Original-To: dhcp-users at webster.isc.org
>To: dhcp-users at isc.org
>Subject: Running omshell from a Shell Script
>Date: Fri, 21 Apr 2006 14:03:06 -0500
>From: Martin McCormick <martin at dc.cis.okstate.edu>
>
> 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