From 7a108fc734d9d36b694f7c24984003076a93bf7f Mon Sep 17 00:00:00 2001 From: Alfonso Gamboa Date: Sat, 4 Jun 2022 04:25:15 -0700 Subject: [PATCH] fix upgrade script when there are line differences between the old and new configs, keep the old config --- SD_ROOT/wz_mini/usr/bin/upgrade-run.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SD_ROOT/wz_mini/usr/bin/upgrade-run.sh b/SD_ROOT/wz_mini/usr/bin/upgrade-run.sh index 2bfbefb..2f4080f 100755 --- a/SD_ROOT/wz_mini/usr/bin/upgrade-run.sh +++ b/SD_ROOT/wz_mini/usr/bin/upgrade-run.sh @@ -102,7 +102,16 @@ rm -f /opt/factory_t31_ZMC6tiIDQN mv /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/factory_t31_ZMC6tiIDQN /opt/factory_t31_ZMC6tiIDQN diff /opt/wz_mini/wz_mini.conf /opt/Upgrade/preserve/wz_mini.conf + +if [ $(cat /opt/Upgrade/preserve/wz_mini.conf | wc -l) != $(cat /opt/wz_mini/wz_mini.conf | wc -l) ]; then +echo "doesn't match, keep old config" +mv /opt/wz_mini/wz_mini.conf /opt/wz_mini/wz_mini.conf.dist cp /opt/Upgrade/preserve/wz_mini.conf /opt/wz_mini/ +else +echo "configs match" +cp /opt/Upgrade/preserve/wz_mini.conf /opt/wz_mini/ +fi + cp /opt/Upgrade/preserve/ssh/* /opt/wz_mini/etc/ssh/ cp /opt/Upgrade/preserve/configs/* /opt/wz_mini/etc/configs cp -r /opt/Upgrade/preserve/wireguard /opt/wz_mini/etc/