banning in one line command
Miguel González
miguel_3_gonzalez at yahoo.es
Wed Feb 1 16:29:50 CET 2017
On 02/01/17 4:25 PM, Dridi Boukelmoune wrote:
> On Wed, Feb 1, 2017 at 3:31 PM, Miguel González
> <miguel_3_gonzalez at yahoo.es> wrote:
>> Dear all,
>>
>> I have Varnish 4.1 and I´m trying to run in one single line command a
>> ban for a particular website. If I run this:
>>
>> root at myserver [~] # varnishadm -T :6082 -S /etc/varnish/secret
>>
>> varnish> ban req.http.host ~ www.myserver.com
>> 200
>>
>> I get the 200 code. However If I run it in a single line I get no 200
>> return code:
>>
>> root at myserver [~] # varnishadm -T :6082 -S /etc/varnish/secret 'ban
>> req.http.host ~ www.myserver.com'
>
> You probably don't need the -T arg for a local access.
>
>> I get nothing. If I try double quotes I get the same...
>>
>> I googled around and I find people asking the same but no solutions.
>>
>> What am I doing wrong?
>
> Nothing wrong: what you are seeing in varnishadm's interactive shell
> is the response status from varnish (see man varnish-cli) but when you
> use varnishadm as a scripting command, only the actual output is
> shown.
>
Thanks for answering!
What do you mean with the actual output? I get an empty string...
Is there any manual or information about this in the wiki?
Thanks
More information about the varnish-misc
mailing list