1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2025-04-06 20:43:01 +02:00

Compare commits

..

2 commits

Author SHA1 Message Date
8d648060c1
Merge c73120295a into e6b5e40bb2 2024-12-17 15:54:51 +01:00
c73120295a
fix(checks): Check vm.max_map_count using cat
This solves multiple issues:
- We don't need `sudo` to check the value anymore
- Some systems may not have `sysctl` available
  - IDK about desktops, but my Debian server doesn't have this command
  (for whatever reason)
2024-12-17 15:54:17 +01:00

View file

@ -406,14 +406,15 @@ check_architecture(){
}
check_map_count(){
[[ $is_steam_deck -gt 0 ]] && return 0
local map_count_file="/proc/sys/vm/max_map_count"
local min_count=1048576
local conf_file="/etc/sysctl.d/dayz.conf"
local current_count
if [[ ! -f /proc/sys/vm/max_map_count ]]; then
logger WARN "File \`/proc/sys/vm/max_map_count\` desn't exist!"
if [[ ! -f ${map_count_file} ]]; then
logger WARN "File '${map_count_file}' doesn't exist!"
return 1
fi
current_count=$(cat /proc/sys/vm/max_map_count)
current_count=$(cat ${map_count_file})
if [[ $current_count -ge $min_count ]]; then
logger DEBUG "System map count is set to ${current_count}"
return 0