From 435c2757257fc89c45e7c89de8173d045c042686 Mon Sep 17 00:00:00 2001
From: aclist <null>
Date: Sun, 7 May 2023 04:40:26 +0900
Subject: [PATCH] fix: fix for #61

---
 changelog.md | 4 ++++
 dzgui.sh     | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/changelog.md b/changelog.md
index ee74a1d..30b1190 100644
--- a/changelog.md
+++ b/changelog.md
@@ -6,6 +6,10 @@
 - Custom query API
 - Store favorites by IP
 
+## [3.2.5] 2023-05-07
+### Fixed
+- Require sudo when checking vm map count
+
 ## [3.2.4] 2023-03-01
 ### Fixed
 - BM API returning stale query port and preventing fetching modlist
diff --git a/dzgui.sh b/dzgui.sh
index d8a895b..ed6ff78 100755
--- a/dzgui.sh
+++ b/dzgui.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 set -o pipefail
-version=3.2.4
+version=3.2.5
 
 aid=221100
 game="dayz"
@@ -1724,7 +1724,7 @@ setup(){
 check_map_count(){
 	count=1048576
 	echo "[DZGUI] Checking system map count"
-	if [[ $(sysctl -q vm.max_map_count | awk -F"= " '{print $2}') -lt $count ]]; then 
+	if [[ $(sudo sysctl -q vm.max_map_count | awk -F"= " '{print $2}') -lt $count ]]; then
 		$steamsafe_zenity --question --width 500 --title="DZGUI" --text "System map count must be $count or higher to run DayZ with Wine.\nIncrease map count and make this change permanent? (will prompt for sudo password)" 2>/dev/null
 		if [[ $? -eq 0 ]]; then
 			pass=$($steamsafe_zenity --password)