From d2969a60854db2b7374c84df2d3ba676c878e5d9 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 2 Sep 2016 13:24:47 +0200 Subject: scripts/save-etc: remove config.adm This file was never used at all and it takes space. Restore-etc only considers .cur and .back. In order to avoid future confusion during debugging sessions, any possibly existing such file is also removed at save time. --- scripts/import-etc | 2 +- scripts/save-etc | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/import-etc b/scripts/import-etc index d18672b..dd61776 100755 --- a/scripts/import-etc +++ b/scripts/import-etc @@ -108,6 +108,7 @@ fi mount_flash_rw || exit 1 +rm -f $FLASHCFG/config.adm 2>/dev/null rm -f $FLASHCFG/config.new 2>/dev/null touch $FLASHCFG/config.new ; chmod 600 $FLASHCFG/config.new if [ "$import_file" = "-" ] ; then @@ -132,7 +133,6 @@ if [ -e "$FLASHCFG/config.cur" ] ; then fi mv $FLASHCFG/config.new $FLASHCFG/config.cur -cp $FLASHCFG/config.cur $FLASHCFG/config.adm cd / umount_flash diff --git a/scripts/save-etc b/scripts/save-etc index 3d7968e..1f5cf34 100755 --- a/scripts/save-etc +++ b/scripts/save-etc @@ -226,6 +226,7 @@ fi if [ $STDOUT -eq 0 -a $TOFILE -eq 0 -a $TONET -eq 0 ]; then mount_flash_rw || exit 1 + rm -f $FLASHCFG/config.adm 2>/dev/null msg=$(rm -f $FLASHCFG/config.new 2>&1) ret=$? msg=$(echo -n $msg | tr '[\000- ]' ' ') @@ -301,10 +302,6 @@ msg=$(mv $FLASHCFG/config.{cur,bak} 2>&1) ret=$? msg=$(echo -n $msg | tr '[\000- ]' ' ') [ $ret = 0 ] || write_journal "5/mv" "config.cur->config.bak: |$msg| status: $ret" -msg=$(cp $FLASHCFG/config.{new,adm} 2>&1) -ret=$? -msg=$(echo -n $msg | tr '[\000- ]' ' ') -[ $ret = 0 ] || write_journal "6/cp" "config.new->config.adm: |$msg| status: $ret" msg=$(mv $FLASHCFG/config.{new,cur} 2>&1) ret=$? if [ $ret -ne 0 ]; then -- 1.7.12.1