fix spaces

This commit is contained in:
CanbiZ 2024-12-05 09:29:44 +01:00
parent 11e1768e78
commit 30bf69c5e5
3 changed files with 8 additions and 8 deletions

View File

@ -66,7 +66,7 @@ function spinner() {
# This function displays an informational message with a yellow color. # This function displays an informational message with a yellow color.
function msg_info() { function msg_info() {
local msg="$1" local msg="$1"
echo -ne " ${TAB}${YW}${msg}" echo -ne "${TAB}${YW}${msg}"
spinner & spinner &
SPINNER_PID=$! SPINNER_PID=$!
} }
@ -123,7 +123,7 @@ function select_storage() {
local TAG=$(echo $line | awk '{print $1}') local TAG=$(echo $line | awk '{print $1}')
local TYPE=$(echo $line | awk '{printf "%-10s", $2}') local TYPE=$(echo $line | awk '{printf "%-10s", $2}')
local FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}') local FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
local ITEM=" Type: $TYPE Free: $FREE " local ITEM="Type: $TYPE Free: $FREE "
local OFFSET=2 local OFFSET=2
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
local MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET)) local MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))

View File

@ -49,7 +49,7 @@ verb_ip6() {
fi fi
} }
# This function sets error handling options and defines the error_handler function to handle errors # This function catches errors and handles them with the error handler function
catch_errors() { catch_errors() {
set -Eeuo pipefail set -Eeuo pipefail
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
@ -168,7 +168,7 @@ motd_ssh() {
fi fi
} }
# This function customizes the container and enabling the passwordless login for the root user # This function customizes the container and enables passwordless login for the root user
customize() { customize() {
if [[ "$PASSWORD" == "" ]]; then if [[ "$PASSWORD" == "" ]]; then
msg_info "Customizing Container" msg_info "Customizing Container"

View File

@ -86,8 +86,8 @@ spinner() {
# This function displays an informational message with a yellow color. # This function displays an informational message with a yellow color.
msg_info() { msg_info() {
local msg="$1" local msg="$1"
echo -ne " ${TAB}${YW}${msg}" echo -ne "${TAB}${YW}${msg}"
spinner & spinner &
SPINNER_PID=$! SPINNER_PID=$!
} }
@ -142,7 +142,7 @@ network_check() {
ipv4_connected=false ipv4_connected=false
ipv6_connected=false ipv6_connected=false
sleep 1 sleep 1
# Check IPv4 connectivity # Check IPv4 connectivity to Google, Cloudflare & Quad9 DNS servers.
if ping -c 1 -W 1 1.1.1.1 &>/dev/null || ping -c 1 -W 1 8.8.8.8 &>/dev/null || ping -c 1 -W 1 9.9.9.9 &>/dev/null; then if ping -c 1 -W 1 1.1.1.1 &>/dev/null || ping -c 1 -W 1 8.8.8.8 &>/dev/null || ping -c 1 -W 1 9.9.9.9 &>/dev/null; then
msg_ok "IPv4 Internet Connected"; msg_ok "IPv4 Internet Connected";
ipv4_connected=true ipv4_connected=true
@ -150,7 +150,7 @@ network_check() {
msg_error "IPv4 Internet Not Connected"; msg_error "IPv4 Internet Not Connected";
fi fi
# Check IPv6 connectivity # Check IPv6 connectivity to Google, Cloudflare & Quad9 DNS servers.
if ping6 -c 1 -W 1 2606:4700:4700::1111 &>/dev/null || ping6 -c 1 -W 1 2001:4860:4860::8888 &>/dev/null || ping6 -c 1 -W 1 2620:fe::fe &>/dev/null; then if ping6 -c 1 -W 1 2606:4700:4700::1111 &>/dev/null || ping6 -c 1 -W 1 2001:4860:4860::8888 &>/dev/null || ping6 -c 1 -W 1 2620:fe::fe &>/dev/null; then
msg_ok "IPv6 Internet Connected"; msg_ok "IPv6 Internet Connected";
ipv6_connected=true ipv6_connected=true