diff options
-rw-r--r-- | recipes-core/multitech/config/config.init | 18 |
1 files 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 |