summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2018-06-04 15:38:53 -0500
committerJohn Klug <john.klug@multitech.com>2018-06-04 15:38:53 -0500
commitcfe8af3b0629368eeb61354e52ec12cc3d8637bd (patch)
tree940764edd35ff5d3ab4d980428fad17f96cc0888
parent2c0dd783f8909a47875d0269b2ea6c6c1165ae8e (diff)
downloadmts-id-eeprom-cfe8af3b0629368eeb61354e52ec12cc3d8637bd.tar.gz
mts-id-eeprom-cfe8af3b0629368eeb61354e52ec12cc3d8637bd.tar.bz2
mts-id-eeprom-cfe8af3b0629368eeb61354e52ec12cc3d8637bd.zip
Add ubpasswd clear feature (-c)0.3.8
-rwxr-xr-xsrc/ubpasswd.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ubpasswd.sh b/src/ubpasswd.sh
index 65e35eb..8a6abf9 100755
--- a/src/ubpasswd.sh
+++ b/src/ubpasswd.sh
@@ -24,7 +24,8 @@ if ! [[ -x /sbin/mts-hashpwd ]] ; then
exit 1
fi
usage() {
- echo "ubpasswd [-u] [-d] [-s salt] [password]"
+ echo "ubpasswd [-c] [-r] [-u] [-d] [-s salt] [password]"
+ echo " -c clear the U-Boot password"
echo " -u means u-boot only (not UNIX password)"
echo " -s salt is user supplied salt"
echo " -r returns true if U-Boot password"
@@ -41,8 +42,13 @@ usage() {
((hassalt=0))
((debug=0))
((upwd=0))
-while getopts ":dfrs:u" opt; do
+while getopts ":cdfrs:u" opt; do
case $opt in
+ c)
+ u-boot setenv mtsp
+ u-boot setenv mtss
+ exit 0
+ ;;
f)
if ! /bin/fgrep "mts password protected" /dev/mtdblock2 >/dev/null 2>&1; then
echo "U-Boot does not support password protection."