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 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..b9213fe 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -256,4 +256,25 @@ create_shell_command_example(){ sed -i "$LINE_COUNT $entry" $PRINTER_CFG done fi +} + +init_ini(){ + 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 + 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 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