fix: relocate the kiauh.ini file to ~/.config to keep values even after reinstalling kiauh.

This commit is contained in:
th33xitus
2021-01-27 18:51:48 +01:00
parent bc53de626f
commit fb52c7e4ab
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -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