OMSHELL script

Allie Hopkins allie at tulane.edu
Tue Sep 10 17:01:52 UTC 2013


Try escaping the quotes.

-Allie

On Tue, Sep 10, 2013 at 11:22 AM, Gregory Sloop <gregs at sloop.net> wrote:
> So, I was working on some simple OMSHELL scripts - and I can
> interactively do these things, but a bash script to do them fails.
>
> If I do the following interactively it works:
> ---
> omshell
> server 10.1.1.1
> port 7911
> key omapi_key "someverysecretkey=="
> connect
> new failover-state
> set name="dhcp-failover"
> set local-state = 4
> update
> ---
> And here's the script - culled from an example in the archives.
> ---
> #!/bin/bash
> # set local server into partner-down mode
> omshell << EOF
> server 10.1.1.1
> port 7911
> key omapi_key "someverysecretkey=="
> connect
> new failover-state
> set name="dhcp-failover"
> set local-state = 4
> update
> EOF
> ---
> Yet here's the output when run as "bash -x script"
>
> + omshell
>> > > > obj: <null>
>> obj: failover-state
>> obj: failover-state
> name = "dhcp-failover"
>> obj: failover-state
> name = "dhcp-failover"
> local-state = 4
>> can't update object: not found
> obj: failover-state
> name = "dhcp-failover"
> local-state = 4
>
> It certainly looks as though it selects the failover-state object, but
> then fails when I try to select the defined dhcp-failover object, and
> so I can't set "local-state" since I never selected an object.
>
> Perhaps this is something wrong with my bash environment - but I
> certainly can't see it. [And if so, it probably doesn't belong here.
> Yet I can't find any similar hits in the archives, and I have no idea
> where to look for what might be getting me on the bash side.]
>
> I'm just lost and I've spent quite a bit of time trying to figure out
> exactly what's causing the issue so I can resolve it without luck.
>
> TIA
> -Greg
>
>
>
>
>
> --
> Gregory Sloop, Principal: Sloop Network & Computer Consulting
> 503.251.0452 x121 Voice | 503.251.0452 Fax
> www.sloop.net
> mailto:gregs at sloop.net
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
>



More information about the dhcp-users mailing list