define([CF_EDITFILES_TAILCHOMP], [patsubst($1, [ +$])])dnl dnl define([CF_EDITFILES_KEYVAL_SEP], [ dnl remove trailing whitespace when looking for the line BeginGroupIfNoLineMatching ['^]CF_EDITFILES_TAILCHOMP($1$2)[.*'] dnl append the key and separator to the end of file Append [']CF_EDITFILES_TAILCHOMP($1$2)['] EndGroup dnl back to the beginning of the file for the next search ResetSearch 1 LocateLineMatching ['^]CF_EDITFILES_TAILCHOMP($1$2)[.*'] BeginGroupIfNoMatch '^$1$2$3$' dnl replace the line if it doesn't look the way it should ReplaceLineWith '$1$2$3' EndGroup dnl back to the beginning for the next search ResetSearch 1] )dnl dnl define([CF_EDITFILES_KEYVAL_EQUALS], CF_EDITFILES_KEYVAL_SEP($1, [ = ], $2))dnl define([CF_EDITFILES_KEYVAL_COLON], CF_EDITFILES_KEYVAL_SEP($1, [: ], $2))dnl define([CF_EDITFILES_KEYVAL_SPACE], CF_EDITFILES_KEYVAL_SEP($1, [ ], $2))dnl dnl dnl dnl Special macro for defining an interface define([CF_EDITFILES_INTERFACE], [ ifelse($4, [], , [#] $4) { /etc/sysconfig/network-scripts/ifcfg-$1 dnl don't want to confuse the ifupdown scripts with backup files Backup 'off' dnl create if necessary AutoCreate dnl CF_EDITFILES_KEYVAL_SEP(DEVICE, =, $1)dnl CF_EDITFILES_KEYVAL_SEP(BOOTPROTO, =, static)dnl CF_EDITFILES_KEYVAL_SEP(ONBOOT, =, yes)dnl CF_EDITFILES_KEYVAL_SEP(IPADDR, =, $2)dnl CF_EDITFILES_KEYVAL_SEP(NETMASK, =, $3)dnl dnl /etc/sysconfig/network has the gateway DeleteLinesMatching '^GATEWAY=.*' dnl DefineClasses [']patsubst($1, [:.+])[_restart'] }] )dnl