#!/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}"