From 2c522e717f74c9dd4cd78f0140a11f32cd9635f8 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Tue, 13 Oct 2020 11:02:42 +0200 Subject: [PATCH 1/4] add: .gitignore for kiauh.ini --- .gitignore | 1 + kiauh.ini | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) create mode 100644 .gitignore delete mode 100644 kiauh.ini diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7de4a4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +kiauh.ini \ No newline at end of file diff --git a/kiauh.ini b/kiauh.ini deleted file mode 100644 index b23a238..0000000 --- a/kiauh.ini +++ /dev/null @@ -1,6 +0,0 @@ -#don't edit this file if you don't know what you are doing... -backup_before_update=false -previous_origin_state=0 -previous_smoothing_state=0 -previous_shaping_state=0 -logupload_accepted=false \ No newline at end of file From b20cda1d155b7888944806d0c6b2f61c2a0a28dd Mon Sep 17 00:00:00 2001 From: th33xitus Date: Tue, 13 Oct 2020 11:41:57 +0200 Subject: [PATCH 2/4] fix: new function to fix #26 --- kiauh.sh | 1 + scripts/functions.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/kiauh.sh b/kiauh.sh index b57d11b..e505991 100755 --- a/kiauh.sh +++ b/kiauh.sh @@ -99,5 +99,6 @@ clear_msg(){ } check_euid +init_ini kiauh_status main_menu \ No newline at end of file diff --git a/scripts/functions.sh b/scripts/functions.sh index 4beee9f..cf1d88c 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -256,4 +256,23 @@ create_shell_command_example(){ sed -i "$LINE_COUNT $entry" $PRINTER_CFG done fi +} + +init_ini(){ + [ ! -f $INI_FILE ] && touch $INI_FILE + if [ ! $(grep -E "^backup_before_update=." $INI_FILE) ]; then + echo -e "\nbackup_before_update=false\c" >> $INI_FILE + fi + if [ ! $(grep -E "^previous_origin_state=[[:alnum:]]" $INI_FILE) ]; then + echo -e "\nprevious_origin_state=0\c" >> $INI_FILE + fi + if [ ! $(grep -E "^previous_smoothing_state=[[:alnum:]]" $INI_FILE) ]; then + echo -e "\nprevious_smoothing_state=0\c" >> $INI_FILE + fi + if [ ! $(grep -E "^previous_shaping_state=[[:alnum:]]" $INI_FILE) ]; then + echo -e "\nprevious_shaping_state=0\c" >> $INI_FILE + fi + if [ ! $(grep -E "^logupload_accepted=." $INI_FILE) ]; then + echo -e "\nlogupload_accepted=false\c" >> $INI_FILE + fi } \ No newline at end of file From dec1c0e83cf5352a5e420f0cf6f94629042be4fa Mon Sep 17 00:00:00 2001 From: th33xitus Date: Tue, 13 Oct 2020 11:55:01 +0200 Subject: [PATCH 3/4] fix: addition to b20cda1 --- scripts/functions.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index cf1d88c..b9213fe 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -259,7 +259,9 @@ create_shell_command_example(){ } init_ini(){ - [ ! -f $INI_FILE ] && touch $INI_FILE + 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 if [ ! $(grep -E "^backup_before_update=." $INI_FILE) ]; then echo -e "\nbackup_before_update=false\c" >> $INI_FILE fi From 759cc8e196ab2c3a02e27859016faea5ebeb4f1a Mon Sep 17 00:00:00 2001 From: th33xitus Date: Tue, 13 Oct 2020 11:58:05 +0200 Subject: [PATCH 4/4] fix: whitespaces --- scripts/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update.sh b/scripts/update.sh index 0b0189b..f0da687 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -32,7 +32,7 @@ update_all(){ echo -e "| ${cyan}● Mainsail${default} |" fi if [ "$FLUIDD_UPDATE_AVAIL" = "true" ]; then - echo -e "| ${cyan}● Fluidd${default} |" + echo -e "| ${cyan}● Fluidd${default} |" fi bottom_border if [ "${#update_arr[@]}" != "0" ]; then