You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.
it seems its very complex to insert xml content variable from shell script to a specific portion of xml based on the condition which satisfying
I have followed many threads in internet and couldn't find any solution to fulfill my requirement here.
HEADER=$(cat <<EOF
<policies>
EOF)
FOOTER==$(cat <<EOF
</policies>
EOF)
IN_IP_FILTER=$(cat <<EOF
<inbound>
<base />
<ip-filter action="allow">
<address-range from="$ipAddressesFrom" to="$ipAddressesTo" />
</ip-filter>
</inbound>
EOF)
################Variables##################
source parse_yaml.sh
eval $(parse_yaml sample2.yaml policy)
echo ".............Eval Result..............................."
for f in $policy_ ; do eval echo \$f \$${f}_ ; done
echo "............Eval Result................................"
echo " ********policy is ************ "
echo "{$IP_FILTER}"
for f in $policy_ ; do
if [[ $(eval echo \$${f}_name) == "ipfilter" ]]; then
echo " given policy name is ipfilter "
for g in $(eval echo \$${f}_session_); do
if [[ $(eval echo \$${g}) == "inbound" ]]; then
echo "add the add above Ipfilter string to the inbound session of xml"
echo "${HEADER}" >> result_$(eval echo \$${f}_name).xml
echo "${IN_IP_FILTER}" >> result_$(eval echo \$${f}_name).xml
fi
if [[ $(eval echo \$${g}) == "outbound" ]]; then
echo "add the add above Ipfilter string to the outbound session of xml"
fi
if [[ $(eval echo \$${g}) == "backend" ]]; then
echo "add the add above Ipfilter string to the backend session of xml"
fi
done
The file which need to customized based on the condition is as below , but need to replace only the content which is satisfying from the condition.
it seems its very complex to insert xml content variable from shell script to a specific portion of xml based on the condition which satisfying
I have followed many threads in internet and couldn't find any solution to fulfill my requirement here.
The file which need to customized based on the condition is as below , but need to replace only the content which is satisfying from the condition.
The text was updated successfully, but these errors were encountered: