Skip to content

Commit

Permalink
set_config_param: added warning
Browse files Browse the repository at this point in the history
  • Loading branch information
joergsteffens committed Jun 12, 2018
1 parent 3f9c7f4 commit b12b42f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/bareos-config-lib.sh.in
Expand Up @@ -575,6 +575,11 @@ set_config_param_in_directory()
# value to set
VALUE="${5}"

if ! [ -e "${DIRECTORY}/${SECTION}" ]; then
warn "failed to set parameter ${SECTION} ${NAME} ${PARAM} = ${VALUE}: directory ${DIRECTORY}/${SECTION} does not exist"
return 1
fi

FILE="${DIRECTORY}/${SECTION}/${NAME}.conf"
if ! [ -f "${FILE}" ]; then
printf "%s {\n Name = %s\n}\n" "${SECTION}" "${NAME}" > "${FILE}"
Expand Down

0 comments on commit b12b42f

Please sign in to comment.