dotfiles/x11/config/eww/scripts/home/mcstatus
2026-04-07 17:56:10 -07:00

13 lines
335 B
Bash
Executable file

#!/usr/bin/env bash
cache_path="${HOME}/.cache/mc-server-info"
mcstatus_cache="${cache_path}/cache.json"
mkdir -p "${cache_path}"
update_cache_json(){
mc-server-info json | tee "${mcstatus_cache}" >/dev/null
}
if [[ ! $(find "${mcstatus_cache}" -cmin -15 -print 2>/dev/null) ]]; then
update_cache_json
fi
cat "${mcstatus_cache}"