diff options
Diffstat (limited to 'src/ubpasswd.sh')
-rwxr-xr-x | src/ubpasswd.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ubpasswd.sh b/src/ubpasswd.sh index 000c831..c379563 100755 --- a/src/ubpasswd.sh +++ b/src/ubpasswd.sh @@ -6,8 +6,8 @@ # and salt. But the password is printed # for reference. # ubpasswd -h will print usage. -if ! [[ -x /sbin/hashpwd ]] ; then - echo Need /sbin/hashpwd to proceed. +if ! [[ -x /sbin/mts-hashpwd ]] ; then + echo Need /sbin/mts-hashpwd to proceed. fi usage() { echo "ubpasswd [-u] [-d] [-s salt] [password]" @@ -60,8 +60,8 @@ mac="${mts}/mac-eth" if ! /bin/fgrep "mts password protected" /dev/mtdblock2 >/dev/null 2>&1; then echo "U-Boot does not support password protection." + exit 1 fi - if ((hassalt == 0)) ; then salt="$(/bin/dd if=/dev/urandom count=1 bs=128 2>/dev/null | /bin/base64 | tr -d '\n' | cut -c1-${saltlen})" fi @@ -81,14 +81,14 @@ if ((upwd == 0)) ; then fi if ((v == 1)) ; then echo Try this: - echo "/sbin/hashpwd -d ${did} -m ${mac} ${salt}" + echo "/sbin/mts-hashpwd -d ${did} -m ${mac} ${salt}" fi - result=$(/sbin/hashpwd -d ${did} -m ${mac} ${salt}) + result=$(/sbin/mts-hashpwd -d ${did} -m ${mac} ${salt}) else - result=$(/sbin/hashpwd -p "${pass}" ${salt}) + result=$(/sbin/mts-hashpwd -p "${pass}" ${salt}) fi if ! [[ $result =~ ^pass=([^[:space:]]+)[[:space:]]+password_hash=([^[:space:]]+) ]] ; then - echo "/sbin/hashpwd failed: ${result}" + echo "/sbin/mts-hashpwd failed: ${result}" exit 1 fi if ((v == 1)) ; then @@ -102,7 +102,7 @@ if ((ubonly == 0)) ; then echo "setting root password to ${pass}" echo -e "${pass}\n${pass}" | /usr/bin/passwd >/dev/null 2>&1 fi -set -e echo "u-boot password is ${pass}" +set -x /usr/bin/u-boot setenv mtss "$salt" /usr/bin/u-boot setenv mtsp "$password_hash" |