fix: new function to fix #26

This commit is contained in:
th33xitus
2020-10-13 11:41:57 +02:00
parent 2c522e717f
commit b20cda1d15
2 changed files with 20 additions and 0 deletions

View File

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

View File

@@ -257,3 +257,22 @@ create_shell_command_example(){
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
}