diff options
author | John Klug <john.klug@multitech.com> | 2017-03-21 16:38:26 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2017-03-21 16:38:26 -0500 |
commit | b9af40d286c0223fd0945eac4d97950fbf80dd45 (patch) | |
tree | 6cb701a9ff7efdb2a7488647a1fa584879ef0bf7 | |
parent | 272561073825a1152c5e349a8c1c540abb9c38c1 (diff) | |
download | mts-id-eeprom-b9af40d286c0223fd0945eac4d97950fbf80dd45.tar.gz mts-id-eeprom-b9af40d286c0223fd0945eac4d97950fbf80dd45.tar.bz2 mts-id-eeprom-b9af40d286c0223fd0945eac4d97950fbf80dd45.zip |
Fix executable names.
-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" |