[Ovirt-devel] [PATCH node-image] Fixes errors in /sbin/dhclient-script.
Perry Myers
pmyers at redhat.com
Thu Jan 22 23:24:35 UTC 2009
Darryl L. Pierce wrote:
> All instances of "mv" are replaced by "cp -a". Four specific instances
> of rm are removed entirely.
>
> Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
> ---
> common-post.ks | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/common-post.ks b/common-post.ks
> index 151cc95..826a82f 100644
> --- a/common-post.ks
> +++ b/common-post.ks
> @@ -78,3 +78,11 @@ cat > /etc/sysconfig/iptables << \EOF
> -A FORWARD -m physdev ! --physdev-is-bridged -j REJECT --reject-with icmp-host-prohibited
> COMMIT
> EOF
> +
> +# remove errors from /sbin/dhclient-script
> +DHSCRIPT=/sbin/dhclient-script
> +sed -i 's/mv/cp -a/g' $DHSCRIPT
> +sed -i 's/rm -f.*${interface}//' $DHSCRIPT
> +sed -i 's/rm -f \/etc\/localtime//' $DHSCRIPT
> +sed -i 's/rm -f \/etc\/ntp.conf//' $DHSCRIPT
> +sed -i 's/rm -f \/etc\/yp.conf//' $DHSCRIPT
ACK assuming this has been tested :) Just a handy tip re: sed
You can do:
sed -i 's^rm -f /etc/yp.conf^^' $DHSCRIPT
The first character after the s becomes the delimiter and then you don't
have to escape the /'s in the filenames. Makes it easier to read, IMHO
but others may disagree :)
Perry
--
|=- Red Hat, Engineering, Emerging Technologies, Boston -=|
|=- Email: pmyers at redhat.com -=|
|=- Office: +1 412 474 3552 Mobile: +1 703 362 9622 -=|
|=- GnuPG: E65E4F3D 88F9 F1C9 C2F3 1303 01FE 817C C5D2 8B91 E65E 4F3D -=|
More information about the ovirt-devel
mailing list