change 'lxc.aa_*' to 'lxc.apparmor.*' if version 3.

This commit is contained in:
2019-06-14 22:57:13 +02:00
parent 4a7ebb6a19
commit a3c8d5c12a
2 changed files with 81 additions and 9 deletions

View File

@@ -275,6 +275,22 @@ else
echo_skipped
fi
echo
echononl " Replace 'lxc.aa_' -> 'lxc.apparmor.'.."
if $(grep -qE "^\s*#*\s*lxc.aa_.*=" "${LXC_ROOT_DIR}/${LXC_NAME}/config" 2> /dev/null) ; then
perl -i.${backup_date} -n -p \
-e "s/^(\s*#*\s*)lxc.aa_(.*)=\s*(.*)/\1lxc.apparmor.\2 = \3/" "${LXC_ROOT_DIR}/${LXC_NAME}/config" \
> $log_file 2>&1
if [[ $? -gt 0 ]]; then
echo_failed
error "$(cat $log_file)"
else
echo_done
fi
else
echo_skipped
fi
echo ""