fix: #26 - .gitignore for kiauh.ini #28

Merged
dw-0 merged 4 commits from work-ini into master 2020-10-13 11:59:35 +02:00
2 changed files with 20 additions and 0 deletions
Showing only changes of commit b20cda1d15 - Show all commits

View File

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

View File

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