script: use whiptail for upload log
This commit is contained in:
24
scripts/ui/upload_yesno.sh
Normal file
24
scripts/ui/upload_yesno.sh
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
upload_yesno(){
|
||||||
|
whiptail --title "Upload Agreement" \
|
||||||
|
--yesno \
|
||||||
|
"The following function will help to quickly upload logs for debugging purposes. With confirming this dialog, you agree that during that process your logs will be uploaded to: http://paste.c-net.org/
|
||||||
|
|
||||||
|
PLEASE NOTE:
|
||||||
|
|
||||||
|
Be aware that logs can contain network information, private data like usernames, filenames, or other information you may not want to make public.
|
||||||
|
|
||||||
|
Do ${red}NOT${default} use this function if you don't agree!
|
||||||
|
|
||||||
|
Do you accept?" \
|
||||||
|
"$KIAUH_WHIPTAIL_NORMAL_HEIGHT" "$KIAUH_WHIPTAIL_NORMAL_WIDTH"
|
||||||
|
|
||||||
|
local out=$?
|
||||||
|
if [ $out -eq 0 ]; then
|
||||||
|
sed -i "/logupload_accepted=/s/false/true/" $INI_FILE
|
||||||
|
clear && print_header && upload_selection
|
||||||
|
else
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -1,46 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
accept_upload_conditions(){
|
|
||||||
while true; do
|
|
||||||
top_border
|
|
||||||
echo -e "| ${red}~~~~~~~~~~~ [ Upload Agreement ] ~~~~~~~~~~~~${default} |"
|
|
||||||
hr
|
|
||||||
echo -e "| The following function will help to quickly upload |"
|
|
||||||
echo -e "| logs for debugging purposes. With confirming this |"
|
|
||||||
echo -e "| dialog, you agree that during that process your logs |"
|
|
||||||
echo -e "| will be uploaded to: ${yellow}http://paste.c-net.org/${default} |"
|
|
||||||
hr
|
|
||||||
echo -e "| ${red}PLEASE NOTE:${default} |"
|
|
||||||
echo -e "| Be aware that logs can contain network information, |"
|
|
||||||
echo -e "| private data like usernames, filenames, or other |"
|
|
||||||
echo -e "| information you may not want to make public. |"
|
|
||||||
blank_line
|
|
||||||
echo -e "| Do ${red}NOT${default} use this function if you don't agree! |"
|
|
||||||
bottom_border
|
|
||||||
read -p "${cyan}Do you accept? (Y/n):${default} " yn
|
|
||||||
case "$yn" in
|
|
||||||
Y|y|Yes|yes|"")
|
|
||||||
sed -i "/logupload_accepted=/s/false/true/" $INI_FILE
|
|
||||||
clear && print_header && upload_selection
|
|
||||||
;;
|
|
||||||
N|n|No|no)
|
|
||||||
clear
|
|
||||||
main_menu #TODO this is the issue causing main menu to not exit
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
clear
|
|
||||||
print_header
|
|
||||||
print_unkown_cmd
|
|
||||||
print_msg && clear_msg
|
|
||||||
accept_upload_conditions;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
upload_selection(){
|
upload_selection(){
|
||||||
source_kiauh_ini
|
source_kiauh_ini
|
||||||
[ "$logupload_accepted" = "false" ] && accept_upload_conditions
|
[ "$logupload_accepted" = "false" ] && upload_yesno
|
||||||
|
|
||||||
### find all suitable logfiles for klipper
|
### find all suitable logfiles for klipper
|
||||||
logfiles=()
|
logfiles=()
|
||||||
|
|||||||
Reference in New Issue
Block a user