From a6e63a67228d7bc5e2af8cd2eb66b981581bbb36 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 13 Nov 2024 11:34:59 +0100 Subject: [PATCH] shfmt --- bash/bash/prompt.sh | 8 ++++---- bash/mount-lxc.sh | 5 ++--- bash/mount.sh | 21 +++++++++------------ bash/proxy.sh | 4 ++-- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/bash/bash/prompt.sh b/bash/bash/prompt.sh index 069b34e..d77a307 100644 --- a/bash/bash/prompt.sh +++ b/bash/bash/prompt.sh @@ -6,21 +6,21 @@ ps1() { local path="${PWD}" local user="${USER}" local view="ā”” " - if [ ${code} -ne 0 ] ; then + if [ ${code} -ne 0 ]; then view="${view}\e[0;31m" else view="${view}\e[0;32m" fi view="${view}${code}\e[0m @ \e[0;33m${date}\e[0m" - if [ "$(type -t __git_ps1)" == "function" ] ; then + if [ "$(type -t __git_ps1)" == "function" ]; then git="$(__git_ps1)" - if [ "${git}" ] ; then + if [ "${git}" ]; then view="${view} ā€“\e[0;35m${git}\e[0m" fi fi view="${view}\n\e[0;36m${path}\e[0m" view="${view}\nā”Œ " - if [ ${EUID} -eq 0 ] ; then + if [ ${EUID} -eq 0 ]; then view="${view}\e[0;31m" else view="${view}\e[0;32m" diff --git a/bash/mount-lxc.sh b/bash/mount-lxc.sh index 2a4b5a1..8cc946e 100644 --- a/bash/mount-lxc.sh +++ b/bash/mount-lxc.sh @@ -1,7 +1,7 @@ mrc() { local container="${1}" local f - for f in "dev" "dev/pts" "proc" "sys" ; do + for f in "dev" "dev/pts" "proc" "sys"; do mount --bind "/${f}" "overlay/mount/var/lib/lxc/${container}/squashfs-root/${f}" done } @@ -15,12 +15,11 @@ crc() { urc() { local container="${1}" local f - for f in "sys" "proc" "dev/pts" "dev" ; do + for f in "sys" "proc" "dev/pts" "dev"; do umount --lazy "overlay/mount/var/lib/lxc/${container}/squashfs-root/${f}" done } - mmc() { local container="${1}" mount --bind "/deb" "overlay/mount/var/lib/lxc/${container}/squashfs-root/deb" diff --git a/bash/mount.sh b/bash/mount.sh index ee14c83..fe5b273 100644 --- a/bash/mount.sh +++ b/bash/mount.sh @@ -1,13 +1,13 @@ mo() { local directory="${1}" local file - if [ -n "${directory}" ] ; then + if [ -n "${directory}" ]; then directory="$(realpath "${directory}")" file="${directory}/filesystem.squashfs" - if mkdir "overlay" ; then + if mkdir "overlay"; then cd "overlay" mkdir {lower,upper,work,mount} - if mount "${file}" "lower" ; then + if mount "${file}" "lower"; then mount \ -o lowerdir="lower",upperdir="upper",workdir="work" \ -t "overlay" \ @@ -22,10 +22,10 @@ mo() { uo() { cd "overlay" - if umount "mount" ; then + if umount "mount"; then rmdir "mount" rm --recursive "upper" "work" - if umount "lower" ; then + if umount "lower"; then rmdir "lower" fi fi @@ -33,10 +33,9 @@ uo() { rmdir "overlay" } - mr() { local f - for f in "dev" "dev/pts" "proc" "sys" ; do + for f in "dev" "dev/pts" "proc" "sys"; do mount --bind "/${f}" "overlay/mount/${f}" done } @@ -54,12 +53,11 @@ chroot \ ur() { local f - for f in "sys" "proc" "dev/pts" "dev" ; do + for f in "sys" "proc" "dev/pts" "dev"; do umount --lazy "overlay/mount/${f}" done } - mm() { mount --make-rslave --rbind "/deb" "overlay/mount/deb" } @@ -68,12 +66,11 @@ um() { umount --recursive "overlay/mount/deb" } - ms() { local directory="${1}" local level="${2}" - if [ -n "${directory}" ] ; then - if mkdir "${directory}" ; then + if [ -n "${directory}" ]; then + if mkdir "${directory}"; then [ -n "${level}" ] || level="18" cp overlay/mount/{vmlinuz,initrd.img} "${directory}" mksquashfs \ diff --git a/bash/proxy.sh b/bash/proxy.sh index 0ccc891..dd154a6 100644 --- a/bash/proxy.sh +++ b/bash/proxy.sh @@ -1,8 +1,8 @@ socks() { local value case "${1}" in - "on") value="manual" ;; - *) value="none" ;; + "on") value="manual" ;; + *) value="none" ;; esac gsettings set "org.gnome.system.proxy" "mode" "${value}" }