~sotirisp/bootsh

0ca6e8e3bc76413244a396323d599252fb3c0529 — Sotiris Papatheodorou 11 months ago e9c3650
Improve code style
1 files changed, 7 insertions(+), 5 deletions(-)

M bootsh
M bootsh => bootsh +7 -5
@@ 81,10 81,9 @@ check_dependencies

# Check for valid input argument.
if [ "$#" -ne 1 ]; then
	printf 'Usage: %s IMAGE\n' "$(basename "$0")"
	printf 'Usage: %s IMAGE\n' "${0##*/}"
	exit 2
fi

if [ ! -s "$1" ]; then
	printf 'Error: %s must be a non-empty file\n' "$1"
	exit 1


@@ 116,8 115,10 @@ while [ -z "$target" ]; do
		# wrong device.
		while true; do
			capacity=$(device_capacity "$device_input")
			printf '\nSelected removable device %s with capacity %s\n' "$device_input" "$capacity"
			printf 'Enter the device capacity (%s) to continue or press Ctrl+C to exit:\n' "$capacity"
			printf '\nSelected removable device %s with capacity %s\n' \
				"$device_input" "$capacity"
			printf 'Enter the device capacity (%s) to continue or press Ctrl+C to exit:\n' \
				"$capacity"
			read -r capacity_input
			capacity_input=$(trim_string "$capacity_input")
			if [ "$capacity_input" = "$capacity" ]; then


@@ 134,7 135,8 @@ device_mount_points "$target" | while IFS= read -r line; do
	mount_point=$(printf '%s\n' "$line" | awk 'BEGIN { FS="\t" }; { print $2 }')
	sync
	if ! umount "$mount_point" > /dev/null 2>&1; then
		printf 'Error: could not unmount partition %s mounted on %s\n' "$partition" "$mount_point"
		printf 'Error: could not unmount partition %s mounted on %s\n' \
			"$partition" "$mount_point"
		exit 1
	fi
done