From 109a08225b2a57c1f0e7635fdd786d3c687c52d1 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 15 Dec 2023 21:21:47 -0500 Subject: [PATCH] Fixed the weird issues with set username showing anonymous: before the name when it shouldn't. Added annonymous configuration code. --- tojam | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tojam b/tojam index ae1c055..be45bff 100755 --- a/tojam +++ b/tojam @@ -116,12 +116,21 @@ configure_ninjam() { exit 0 fi case "${setting}" in + "anonymous") + anonymous="$(dialog --yesno "Login anonymously? (You still have a username but password is not required.)" -1 -1 --stdout)" + anonymous=$? + [[ ${anonymous} -eq 255 ]] && continue + anonymous="${anonymous/0/true}" + anonymous="${anonymous/1/false}" + sed -i "s/^anonymous=.*/anonymous=\"${anonymous}\"/" "${config}/config" && + dialog --msgbox "Anonymous login set to ${anonymous}." -1 -1 + ;; "sound driver") soundDriver="$(dialog --yes-label "alsa" \ --no-label "jack" \ --yesno "Select a sound driver" -1 -1 --stdout)" soundDriver=$? - [[ $? -eq 255 ]] && continue + [[ ${soundDriver} -eq 255 ]] && continue soundDriver="${soundDriver/0/alsa}" soundDriver="${soundDriver/1/jack}" if [[ "${soundDriver}" == "jack" ]]; then @@ -135,7 +144,6 @@ configure_ninjam() { --inputbox "Enter User Name (letters, numbers, dash, and underscore accepted):" -1 -1 "${userName#*anonymous:}" --stdout)" menuCode=$? [[ ${menuCode} -ne 0 ]] && continue - [[ "${anonymous}" == "true" ]] && userName="anonymous:${userName}" sed -i "s/^userName=.*/userName='${userName}'/" "${config}/config" && dialog --msgbox "Username set to \"${userName#*anonymous:}\"." -1 -1 ;;