Added copy() and filter_system_files()

This commit is contained in:
Gerhard Hoffmann 2022-06-05 16:50:04 +02:00
parent 83b420acf2
commit 96a8065fe0

View File

@ -31,6 +31,47 @@ fetch_customer_updates() {
return 0 return 0
} }
copy () {
local func="${FUNCNAME[0]}"
readarray -td' ' files <<< "$1"
for f in ${files[@]}; do
if grep -qE "^.*[.]conf.*$" <<< ${f}; then
local __f="${psa_config}/${f}"
if ! cp ${__f} /etc/psa_config; then
log_error "$func:${LINENO}: cannot cp ${__f} /etc/psa_config"
return 1
fi
log_info "$func:${LINENO}: copied $f to /etc/psa_config"
# elif grep -qE "^.*[.]ini.*$" <<< ${f}; then
# if ! cp ${f} $psa_ini; then
# return 1
# fi
fi
done
log_debug "$func:${LINENO}: copied *conf/*ini-files to system-dirs"
return 0;
}
filter_system_files () {
local func="${FUNCNAME[0]}"
readarray -td' ' files <<< "$1"
local __system_files=""
for f in ${files[@]}; do
case "$f" in
("emp.conf"|"printer.conf"|"device.conf")
__system_files+="${f} "
;;
esac
done
log_debug "$func:${LINENO} system-files=$__system_files"
printf '%s' "$__system_files"
}
# Check if the fetched/merged files have the correct md5 and are # Check if the fetched/merged files have the correct md5 and are
# valid for the PSA. # valid for the PSA.
# #