1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2025-04-09 14:02:59 +02:00

Compare commits

..

2 commits

Author SHA1 Message Date
66eb4cf6d4
Merge ae01c04caa into e6b5e40bb2 2024-12-15 09:14:03 +09:00
ae01c04caa
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-13 02:51:30 +01:00

View file

@ -406,15 +406,14 @@ 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 ${map_count_file} ]]; then
logger WARN "File '${map_count_file}' doesn't exist!"
if [[ ! -f /proc/sys/vm/max_map_count ]]; then
logger WARN "File \`/proc/sys/vm/max_map_count\` desn't exist!"
return 1
fi
current_count=$(cat ${map_count_file})
current_count=$(cat /proc/sys/vm/max_map_count)
if [[ $current_count -ge $min_count ]]; then
logger DEBUG "System map count is set to ${current_count}"
return 0