Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions board/common/rootfs/usr/bin/askline
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/sh
#!/bin/bash
# Prompt for a single-line value, prefilled with the current one.
#
# askline LABEL FILE
#
# FILE holds the current value on entry and the new value on exit.
# shellcheck disable=SC3045

LABEL=$1
FILE=$2
Expand Down
8 changes: 4 additions & 4 deletions board/common/rootfs/usr/bin/askpass
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ if [ "$1" = "-b" ]; then
fi
OUTPUT=$1

read -r -s -p "$LABEL: " secret
read -r -s -p "$LABEL: " secret || exit 1
>&2 echo
read -r -s -p "Retype $LABEL: " secret_again
read -r -s -p "Retype $LABEL: " secret_again || exit 1
>&2 echo

if [ "$secret" != "$secret_again" ]; then
echo "${LABEL}s do not match, try again."
>&2 echo "${LABEL}s do not match, try again."
exit 1
fi

if [ -z "$secret" ]; then
echo "Empty $LABEL, try again."
>&2 echo "Empty $LABEL, try again."
exit 1
fi

Expand Down