Merge pull request #28 from th33xitus/work-ini

fix: #24 - .gitignore for kiauh.ini
This commit is contained in:
th33xitus
2020-10-13 11:59:35 +02:00
committed by GitHub
5 changed files with 24 additions and 7 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
kiauh.ini

View File

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

View File

@@ -99,5 +99,6 @@ clear_msg(){
}
check_euid
init_ini
kiauh_status
main_menu

View File

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

View File

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