mirror of
https://github.com/ben-grande/qusal.git
synced 2025-04-16 05:33:08 -04:00
feat: shorten long commands
This commit is contained in:
parent
f63b5132ba
commit
bc1072d099
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2023 - 2025 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@ -26,9 +26,9 @@ writeconf(){
|
||||
value="$3"
|
||||
|
||||
group_id="$(grep -B1 -e "^Description=${group}$" -- "${file}" | head -1 |
|
||||
tr -d "[" | tr -d "]")"
|
||||
tr -d "\[\]")"
|
||||
if test -z "${group_id}"; then
|
||||
highest_id="$(grep -e "\[[0-9]\+\]" -- "${file}" | tr -d "[" | tr -d "]" |
|
||||
highest_id="$(grep -e "\[[0-9]\+\]" -- "${file}" | tr -d "\[\]" |
|
||||
sort | tail -1)"
|
||||
if test -n "${highest_id}"; then
|
||||
group_id="$((highest_id+1))"
|
||||
|
@ -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))"
|
||||
|
Loading…
x
Reference in New Issue
Block a user