feat: shorten long commands

This commit is contained in:
Ben Grande 2025-01-17 19:12:54 +01:00
parent f63b5132ba
commit bc1072d099
No known key found for this signature in database
GPG key ID: 00C64E14F51F9E56
2 changed files with 5 additions and 7 deletions

View file

@ -6,12 +6,10 @@
set -eu
conf="${HOME}/.bitcoin/conf.d/dbcache.conf"
domid="$(xenstore-read -- domid)"
xenstore_mem_dir="/local/domain/${domid}/memory"
if test -f /var/run/qubes-service/meminfo-writer; then
mem_KiB="$(xenstore-read -- "${xenstore_mem_dir}/hotplug-max")"
mem_KiB="$(xenstore-read -- memory/hotplug-max)"
else
mem_KiB="$(xenstore-read -- "${xenstore_mem_dir}/static-max")"
mem_KiB="$(xenstore-read -- memory/static-max)"
fi
cache_MiB=$((mem_KiB/1024))
cache="$((cache_MiB*80/100))"