Browse Source

bkctld-upgrade-config: install check_policy template if missing

master
Jérémy Lecour 4 months ago
committed by Jérémy Lecour
parent
commit
82dbb29511
  1. 1
      CHANGELOG.md
  2. 10
      lib/bkctld-upgrade-config

1
CHANGELOG.md

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
* bkctld-init: install check_policy template
* bkctld-upgrade-config: install check_policy template if missing
* test: bkctld check-incs shouldn't fail without incs_policy file
### Changed

10
lib/bkctld-upgrade-config

@ -45,3 +45,13 @@ elif [ -f "${legacy_incs_policy_file}" ]; then
info "${jail_name}: config has been upgraded"
fi
check_policy_file=$(jail_check_policy_file "${jail_name}")
if [ ! -f "${check_policy_file}" ]; then
check_policy_tpl="${TPLDIR}/check_policy.tpl"
test -f "${LOCALTPLDIR}/check_policy.tpl" && check_policy_tpl="${LOCALTPLDIR}/check_policy.tpl"
mkdir --parents "$(dirname "${check_policy_file}")"
install -m 0640 "${check_policy_tpl}" "${check_policy_file}"
info "${jail_name}: check_policy template ha been installed"
fi
Loading…
Cancel
Save