Fix loading Nomad policies

This commit is contained in:
Daniel Berteaud 2024-03-25 09:37:43 +01:00
parent 653dc437c7
commit 9a14ef5d3b
1 changed files with 1 additions and 1 deletions

2
ctctl
View File

@ -314,7 +314,7 @@ ctctl_load_policies(){
echo "No valid nomad token. You have to authenticate first"
ctctl_exit
fi
for PFILE in $(ls ${DIR}nomad/policies/*.hcl 2>/dev/null); do
for PFILE in $(ls ${DIR}/nomad/policies/*.hcl 2>/dev/null); do
PNAME=$(basename ${PFILE} .hcl)
if [ "${DIR}" = "./output" -a -e "$(echo ${PFILE} | sed -E 's|^\./output/|./|')" ]; then
echo "Skiping ${PFILE} as $(echo ${PFILE} | sed -E 's|^\./output/|./|') will take precedence"