From add1ec561917b2bd75f25b00d70ccc6145e0bd5a Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Mon, 19 Jun 2023 05:40:26 +0900 Subject: [PATCH] chore: additional logging --- dzgui.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dzgui.sh b/dzgui.sh index a041098..f3750c9 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=3.3.3 +version=3.3.4 aid=221100 game="dayz" @@ -1129,7 +1129,8 @@ popup(){ 600) pop "No preferred servers set." ;; 700) pop "Toggled to Flatpak Steam." ;; 800) pop "Toggled to native Steam." ;; - 900) pop "This feature is not supported on Steam Deck." + 900) pop "This feature is not supported on Steam Deck." ;; + 1000) pop "No recent history." esac } toggle_console_dl(){ @@ -1759,16 +1760,23 @@ check_map_count(){ echo "[DZGUI] Checking system map count" if [[ ! -f /etc/sysctl.d/dayz.conf ]]; then $steamsafe_zenity --question --width 500 --title="DZGUI" --cancel-label="Cancel" --ok-label="OK" --text "sudo password required to check system vm map count." 2>/dev/null - if [[ $? -eq 0 ]]; then + local rc=$? + logger INFO "Return code is $rc" + if [[ $rc -eq 0 ]]; then local pass + logger INFO "Prompting user for sudo escalation" pass=$($steamsafe_zenity --password) - [[ $? -eq 1 ]] && exit 1 + local rc + logger INFO "Return code is $rc" + [[ $rc -eq 1 ]] && exit 1 local ct=$(sudo -S <<< "$pass" sh -c "sysctl -q vm.max_map_count | awk -F'= ' '{print \$2}'") local new_ct [[ $ct -lt $count ]] && ct=$count + logger INFO "Updating map count" sudo -S <<< "$pass" sh -c "echo 'vm.max_map_count=$ct' > /etc/sysctl.d/dayz.conf" sudo sysctl -p /etc/sysctl.d/dayz.conf else + logger INFO "Zenity dialog failed or user exit" exit 1 fi fi