[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: resolve action and variable
From: |
Andrew Stribblehill |
Subject: |
Re: resolve action and variable |
Date: |
Wed, 24 Jul 2002 17:18:02 +0100 |
User-agent: |
Mutt/1.4i |
Quoting Sabrina Lautier <slautier@lavache.com> (2002-07-22 09:11:43 BST):
> Hi !
>
> Any idea of how to insert variables into the resolve action with
> cfengine version 2.0.1 ?
>
> **********************************
> control:
> endline = ( "END" )
>
> resolve:
> "domain toto.com"
> nameserver1_IP@
> nameserver2_IP@
> "search ..."
> "$(endline)"
> **********************************
> This inserts $(endline) in resolv.conf instead of END.
> Any idea of how to insert a variable value with the resolve
> action ?
The following patch to EditItemsInResolvConf (do.c:3000) does that:
--- do.c.orig Tue Jun 18 11:46:58 2002
+++ do.c Wed Jul 24 17:11:29 2002
@@ -2997,9 +2997,10 @@
{
strcpy(buf,from->name);
}
-
- DeleteItemMatching(list,buf); /* del+prep = move to head of list */
- PrependItem(list,buf,NULL);
+
+ ExpandVarstring(buf, VBUFF, "");
+ DeleteItemMatching(list,VBUFF); /* del+prep = move to head of list */
+ PrependItem(list,VBUFF,NULL);
return;
}
}
--
FAIR ISLE
NORTHWESTERLY 3 OR 4, OCCASIONALLY 5, BACKING SOUTHERLY 5 OR 6,
VEERING SOUTHWESTERLY 4 OR 5 IN SOUTHWEST LATER. SHOWERS THEN RAIN.
GOOD BECOMING MODERATE