mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-29 12:13:01 +02:00
With Classic builds out of the way we can move everything back to common again to simplify and reduce our collective cognitive overhead a bit. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
24 lines
385 B
Bash
Executable File
24 lines
385 B
Bash
Executable File
#!/bin/sh
|
|
# shellcheck disable=SC3045
|
|
|
|
OUTPUT=$1
|
|
|
|
read -r -s -p "New password: " password
|
|
>&2 echo
|
|
read -r -s -p "Retype password: " password_again
|
|
>&2 echo
|
|
|
|
if [ "$password" != "$password_again" ]; then
|
|
echo "Passwords do not match, try again."
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$OUTPUT" ]; then
|
|
echo "$password"
|
|
exit 0
|
|
fi
|
|
|
|
umask 0177
|
|
echo "$password" | mkpasswd > "$OUTPUT"
|
|
exit 0
|