diff options
-rwxr-xr-x | src/ubpasswd.sh | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/ubpasswd.sh b/src/ubpasswd.sh index 1c0e1dd..98347fb 100755 --- a/src/ubpasswd.sh +++ b/src/ubpasswd.sh @@ -24,7 +24,7 @@ if ! [[ -x /sbin/mts-hashpwd ]] ; then exit 1 fi usage() { - echo "ubpasswd [-c] [-d] [-n] [-i] [-m] [-u] [-r] [-f] [-s salt] [password]" + echo "mts-ubpasswd [-c] [-d] [-n] [-i] [-m] [-u] [-r] [-f] [-s salt] [password]" echo " -c clear the U-Boot password" echo " -d debug" echo " -n dryrun for setting password" @@ -206,14 +206,10 @@ if ((upwd == 0)) ; then else result=$(/sbin/mts-hashpwd -p "${pass}" ${salt}) fi -if ! [[ $result =~ ^pass=([^[:space:]]+)[[:space:]]+password_hash=([^[:space:]]+) ]] ; then +if ! [[ $result =~ ^pass=([^$'\n']+)$'\n'password_hash=([^$'\n']+) ]] ; then echo "/sbin/mts-hashpwd failed: ${result}" exit 1 fi -if ((debug)) ; then - echo result is: - echo "$result" -fi pass="${BASH_REMATCH[1]}" password_hash="${BASH_REMATCH[2]}" echo "uboot password hash: \"$password_hash\"" |