Skip to content

Commit

Permalink
style: Quote variables (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Jan 14, 2024
1 parent 0f94f9d commit 5265486
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -x --source-path=src -e SC2001 -e SC2223 -e SC2034 -e SC2064 -e SC2317 -e SC2153
SHELLCHECK_OPTS: -x --source-path=src -e SC2001 -e SC2034 -e SC2064 -e SC2317 -e SC2153
2 changes: 1 addition & 1 deletion src/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -Eeuo pipefail

# Docker environment variables

: ${BOOT_MODE:='legacy'} # Boot mode
: "${BOOT_MODE:='legacy'}" # Boot mode

SECURE=""
BOOT_OPTS=""
Expand Down
26 changes: 13 additions & 13 deletions src/disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ set -Eeuo pipefail

# Docker environment variables

: ${DISK_IO:='native'} # I/O Mode, can be set to 'native', 'threads' or 'io_turing'
: ${DISK_FMT:=''} # Disk file format, can be set to "raw" or "qcow2" (default)
: ${DISK_FLAGS:=''} # Specifies the options for use with the qcow2 disk format
: ${DISK_CACHE:='none'} # Caching mode, can be set to 'writeback' for better performance
: ${DISK_DISCARD:='on'} # Controls whether unmap (TRIM) commands are passed to the host.
: ${DISK_ROTATION:='1'} # Rotation rate, set to 1 for SSD storage and increase for HDD
: "${DISK_IO:='native'}" # I/O Mode, can be set to 'native', 'threads' or 'io_turing'
: "${DISK_FMT:=''}" # Disk file format, can be set to "raw" or "qcow2" (default)
: "${DISK_FLAGS:=''}" # Specifies the options for use with the qcow2 disk format
: "${DISK_CACHE:='none'}" # Caching mode, can be set to 'writeback' for better performance
: "${DISK_DISCARD:='on'}" # Controls whether unmap (TRIM) commands are passed to the host.
: "${DISK_ROTATION:='1'}" # Rotation rate, set to 1 for SSD storage and increase for HDD

BOOT="$STORAGE/$BASE"
DRIVERS="$STORAGE/drivers.img"
Expand Down Expand Up @@ -449,14 +449,14 @@ else
DISK_ALLOC="preallocation=falloc"
fi

: ${DISK2_SIZE:=''}
: ${DISK3_SIZE:=''}
: ${DISK4_SIZE:=''}
: "${DISK2_SIZE:=''}"
: "${DISK3_SIZE:=''}"
: "${DISK4_SIZE:=''}"

: ${DEVICE:=''} # Docker variables to passthrough a block device, like /dev/vdc1.
: ${DEVICE2:=''}
: ${DEVICE3:=''}
: ${DEVICE4:=''}
: "${DEVICE:=''}" # Docker variables to passthrough a block device, like /dev/vdc1.
: "${DEVICE2:=''}"
: "${DEVICE3:=''}"
: "${DEVICE4:=''}"

if [ -n "$DEVICE" ]; then
addDevice "userdata" "$DEVICE" "device" "1" "0xa" || exit $?
Expand Down
4 changes: 2 additions & 2 deletions src/display.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -Eeuo pipefail

# Docker environment variables

: ${GPU:='N'} # GPU passthrough
: ${DISPLAY:='none'} # Display type
: "${GPU:='N'}" # GPU passthrough
: "${DISPLAY:='none'}" # Display type

case "${DISPLAY,,}" in
vnc)
Expand Down
24 changes: 12 additions & 12 deletions src/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ set -Eeuo pipefail

# Docker environment variables

: ${DHCP:='N'}
: ${HOST_PORTS:=''}
: ${MAC:='82:cf:d0:5e:57:66'}

: ${VM_NET_DEV:=''}
: ${VM_NET_TAP:='qemu'}
: ${VM_NET_MAC:="$MAC"}
: ${VM_NET_HOST:='QEMU'}

: ${DNSMASQ_OPTS:=''}
: ${DNSMASQ:='/usr/sbin/dnsmasq'}
: ${DNSMASQ_CONF_DIR:='/etc/dnsmasq.d'}
: "${DHCP:='N'}"
: "${HOST_PORTS:=''}"
: "${MAC:='82:cf:d0:5e:57:66'}"

: "${VM_NET_DEV:=''}"
: "${VM_NET_TAP:='qemu'}"
: "${VM_NET_MAC:="$MAC"}"
: "${VM_NET_HOST:='QEMU'}"

: "${DNSMASQ_OPTS:=''}"
: "${DNSMASQ:='/usr/sbin/dnsmasq'}"
: "${DNSMASQ_CONF_DIR:='/etc/dnsmasq.d'}"

ADD_ERR="Please add the following setting to your container:"

Expand Down
6 changes: 3 additions & 3 deletions src/proc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ set -Eeuo pipefail

# Docker environment variables

: ${KVM:='Y'}
: ${CPU_MODEL:='host'}
: ${CPU_FEATURES:='+ssse3,+sse4.1,+sse4.2'}
: "${KVM:='Y'}"
: "${CPU_MODEL:='host'}"
: "${CPU_FEATURES:='+ssse3,+sse4.1,+sse4.2'}"

[ "$ARCH" != "amd64" ] && KVM="N"

Expand Down
14 changes: 7 additions & 7 deletions src/reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ trap 'error "Status $? while: $BASH_COMMAND (line $LINENO/$BASH_LINENO)"' ERR

# Docker environment variables

: ${BOOT:=''} # URL of the ISO file
: ${DEBUG:='N'} # Disable debugging
: ${ALLOCATE:=''} # Preallocate diskspace
: ${ARGUMENTS:=''} # Extra QEMU parameters
: ${CPU_CORES:='1'} # Amount of CPU cores
: ${RAM_SIZE:='1G'} # Maximum RAM amount
: ${DISK_SIZE:='16G'} # Initial data disk size
: "${BOOT:=''}" # URL of the ISO file
: "${DEBUG:='N'}" # Disable debugging
: "${ALLOCATE:=''}" # Preallocate diskspace
: "${ARGUMENTS:=''}" # Extra QEMU parameters
: "${CPU_CORES:='1'}" # Amount of CPU cores
: "${RAM_SIZE:='1G'}" # Maximum RAM amount
: "${DISK_SIZE:='16G'}" # Initial data disk size

# Helper variables

Expand Down

0 comments on commit 5265486

Please sign in to comment.