From 4de682c7f15390eaf982b2db1573ec65020f70b4 Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 4 Dec 2017 18:38:37 -0600 Subject: Do not copy non-existent stuff, and copy the old files from the old directory. --- recipes-core/multitech/config/config.init | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/recipes-core/multitech/config/config.init b/recipes-core/multitech/config/config.init index bb21888..3bdd78b 100644 --- a/recipes-core/multitech/config/config.init +++ b/recipes-core/multitech/config/config.init @@ -139,9 +139,21 @@ case $1 in mkdir old if ! [[ -f $file ]] ; then # Need to preserve old files which is difficult with busybox! - cp --parents -a $file old || true - (cd /etc;cp --parents -a $file ${CONFIG_DIR}) || true - cp --parents -a old/$file . || true + if [[ -d $file ]] || [[ -f $file ]] ; then + cp --parents -a $file old || true + fi + ( + cd /etc + if [[ -d $file ]] || [[ -f $file ]] ; then + cp --parents -a $file ${CONFIG_DIR} || true + fi + ) + ( + cd old + if [[ -d $file ]] || [[ -f $file ]] ; then + cp --parents -a $file .. || true + fi + ) rm -rf old fi rm -rf /etc/$file -- cgit v1.2.3