mirror of
https://github.com/ben-grande/qusal.git
synced 2025-07-26 07:55:31 -04:00
feat: shorten long commands
This commit is contained in:
parent
f63b5132ba
commit
bc1072d099
2 changed files with 5 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/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
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ writeconf(){
|
||||||
value="$3"
|
value="$3"
|
||||||
|
|
||||||
group_id="$(grep -B1 -e "^Description=${group}$" -- "${file}" | head -1 |
|
group_id="$(grep -B1 -e "^Description=${group}$" -- "${file}" | head -1 |
|
||||||
tr -d "[" | tr -d "]")"
|
tr -d "\[\]")"
|
||||||
if test -z "${group_id}"; then
|
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)"
|
sort | tail -1)"
|
||||||
if test -n "${highest_id}"; then
|
if test -n "${highest_id}"; then
|
||||||
group_id="$((highest_id+1))"
|
group_id="$((highest_id+1))"
|
||||||
|
|
|
@ -6,12 +6,10 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
conf="${HOME}/.bitcoin/conf.d/dbcache.conf"
|
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
|
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
|
else
|
||||||
mem_KiB="$(xenstore-read -- "${xenstore_mem_dir}/static-max")"
|
mem_KiB="$(xenstore-read -- memory/static-max)"
|
||||||
fi
|
fi
|
||||||
cache_MiB=$((mem_KiB/1024))
|
cache_MiB=$((mem_KiB/1024))
|
||||||
cache="$((cache_MiB*80/100))"
|
cache="$((cache_MiB*80/100))"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue