From fb52c7e4ab6cbe9788b0a115f3f709d92ceb8ee0 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Wed, 27 Jan 2021 18:51:48 +0100 Subject: [PATCH] fix: relocate the kiauh.ini file to ~/.config to keep values even after reinstalling kiauh. --- kiauh.sh | 2 +- scripts/functions.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/kiauh.sh b/kiauh.sh index ce86d7a..33e781c 100755 --- a/kiauh.sh +++ b/kiauh.sh @@ -39,7 +39,7 @@ OCTOPRINT_DIR=${HOME}/OctoPrint KLIPPERSCREEN_DIR=${HOME}/KlipperScreen KLIPPERSCREEN_ENV_DIR=${HOME}/.KlipperScreen-env #misc -INI_FILE=${SRCDIR}/kiauh/kiauh.ini +INI_FILE=${HOME}/.config/kiauh.ini BACKUP_DIR=${HOME}/kiauh-backups ### set github repos diff --git a/scripts/functions.sh b/scripts/functions.sh index 1e30472..e8823c2 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -464,6 +464,10 @@ write_printer_cfg(){ } init_ini(){ + ### copy an existing kiauh.ini to its new location to keep all possible saved values + if [ -f ${SRCDIR}/kiauh/kiauh.ini ] || [ ! -f $INI_FILE ]; then + cp ${SRCDIR}/kiauh/kiauh.ini $INI_FILE + fi if [ ! -f $INI_FILE ]; then echo -e "#don't edit this file if you don't know what you are doing...\c" > $INI_FILE fi