diff options
Diffstat (limited to 'security/ossec-hids-local-config/scripts')
3 files changed, 10 insertions, 7 deletions
diff --git a/security/ossec-hids-local-config/scripts/plist.sh b/security/ossec-hids-local-config/scripts/plist.sh index b1915c4..07fbcd5 100644 --- a/security/ossec-hids-local-config/scripts/plist.sh +++ b/security/ossec-hids-local-config/scripts/plist.sh @@ -61,10 +61,10 @@ while read line; do path="" case ${line} in "@dir %%OSSEC_HOME%%"*) - path=`echo "${line}" | sed -e "s|@dir %%OSSEC_HOME%%||g"` + path=`echo "${line}" | sed -E 's|@dir %%OSSEC_HOME%%||g'` ;; "%%OSSEC_HOME%%"*) - path=`echo "${line}" | sed -e "s|%%OSSEC_HOME%%||g"` + path=`echo "${line}" | sed -E 's|%%OSSEC_HOME%%||g'` ;; "%%"*) unchanged_lines="${unchanged_lines}${NL}${line}" diff --git a/security/ossec-hids-local-config/scripts/template-to-agent.sh b/security/ossec-hids-local-config/scripts/template-to-agent.sh index 3034b1f..7c11b82 100644 --- a/security/ossec-hids-local-config/scripts/template-to-agent.sh +++ b/security/ossec-hids-local-config/scripts/template-to-agent.sh @@ -19,7 +19,8 @@ ossec_syscheck_bin_dirs="${ossec_prefix}/bin,${ossec_prefix}/active-response" ossec_syscheck_etc_dirs="${ossec_prefix}/etc" replace() { - sed -e 's|<template_config \(.*\)>|<agent_config \1>|' \ + sed -E \ + -e 's|<template_config (.*)>|<agent_config \1>|' \ -e 's|</template_config>|</agent_config>|' \ -e "s|%%OSSEC_SYSCHECK_BIN_DIRS%%|${ossec_syscheck_bin_dirs}|" \ -e "s|%%OSSEC_SYSCHECK_ETC_DIRS%%|${ossec_syscheck_etc_dirs}|" \ @@ -27,7 +28,7 @@ replace() { } extract() { - sed -n '/^<agent_config .*>$/,/^<\/agent_config>$/p' + sed -En '/^<agent_config .*>$/,/^<\/agent_config>$/p' } replace | extract diff --git a/security/ossec-hids-local-config/scripts/template-to-ossec.sh b/security/ossec-hids-local-config/scripts/template-to-ossec.sh index 3933446..5ad3228 100644 --- a/security/ossec-hids-local-config/scripts/template-to-ossec.sh +++ b/security/ossec-hids-local-config/scripts/template-to-ossec.sh @@ -24,13 +24,15 @@ fi replace() { if grep -q "<template_config>" "${ossec_file}"; then - sed -e 's|<template_config>|<ossec_config>|' \ + sed -E \ + -e 's|<template_config>|<ossec_config>|' \ -e 's|</template_config>|</ossec_config>|' \ -e "s|%%OSSEC_SYSCHECK_BIN_DIRS%%|${ossec_syscheck_bin_dirs}|" \ -e "s|%%OSSEC_SYSCHECK_ETC_DIRS%%|${ossec_syscheck_etc_dirs}|" \ "${ossec_file}" else - sed -e 's|<template_config .*os="FreeBSD".*>|<ossec_config>|' \ + sed -E \ + -e 's|<template_config .*os="FreeBSD".*>|<ossec_config>|' \ -e 's|</template_config>|</ossec_config>|' \ -e "s|%%OSSEC_SYSCHECK_BIN_DIRS%%|${ossec_syscheck_bin_dirs}|" \ -e "s|%%OSSEC_SYSCHECK_ETC_DIRS%%|${ossec_syscheck_etc_dirs}|" \ @@ -39,7 +41,7 @@ replace() { } extract() { - sed -n '/^<ossec_config.*>$/,/^<\/ossec_config>$/p' + sed -En '/^<ossec_config.*>$/,/^<\/ossec_config>$/p' } replace | extract |