| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #!/bin/bash
- echo -e ""
- echo -e "0.1 - Full comparison Output"
- echo -e "=================================================================="
- echo -e "Description:"
- echo -e "test checks that vars present in ALL _default.cfg files are correct."
- echo -e ""
- find "lgsm/config-default/config-lgsm/" ! -name '*template.cfg' -name "*.cfg" -type f -print0 |
- while IFS= read -r -d $'\0' line; do
- grep = ${line} | cut -f1 -d"=" > defaultcfgtemp.txt
- diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt)
- if [ "${diffoutput}" ]; then
- echo "File with errors:"
- echo "${line}"
- echo -e "================================="
- echo "${diffoutput}"
- echo ""
- fi
- rm defaultcfgtemp.txt
- done
- echo -e ""
- echo -e "1.0 - Master Comparison"
- echo -e "=================================================================="
- echo -e "Description:"
- echo -e "test checks that vars present in ALL _default.cfg files are correct."
- echo -e ""
- find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 |
- while IFS= read -r -d $'\0' line; do
- grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt
- diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt | grep '^<')
- if [ "${diffoutput}" ]; then
- echo "File with errors:"
- echo "${line}"
- echo -e "================================="
- echo "${diffoutput}"
- echo ""
- fi
- rm defaultcfgtemp.txt
- done
- echo -e ""
- echo -e "2.0 - Check Comment"
- echo -e "=================================================================="
- echo -e "Description:"
- echo -e "test checks that comments in ALL _default.cfg files are correct."
- echo -e ""
- find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 |
- while IFS= read -r -d $'\0' line; do
- grep "#" "${line}" > defaultcfgtemp.txt
- diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_1.txt defaultcfgtemp.txt | grep '^<')
- if [ "${diffoutput}" ]; then
- echo "File with errors:"
- echo "${line}"
- echo -e "================================="
- echo "${diffoutput}"
- echo ""
- fi
- rm defaultcfgtemp.txt
- done
|