diff options
author | Patrick Murphy <Patrick.Murphy@multitech.com> | 2020-05-18 15:19:06 -0500 |
---|---|---|
committer | Patrick Murphy <Patrick.Murphy@multitech.com> | 2020-05-18 15:19:06 -0500 |
commit | d8c750c0968173444ac5c16af9ec8f1f7996935c (patch) | |
tree | 270568d33a203609e3ad53214a4c7a92e924e6f0 | |
parent | 38a9fecc12d71cf88aa4667f694dbf5739127b26 (diff) | |
download | commissioning-d8c750c0968173444ac5c16af9ec8f1f7996935c.tar.gz commissioning-d8c750c0968173444ac5c16af9ec8f1f7996935c.tar.bz2 commissioning-d8c750c0968173444ac5c16af9ec8f1f7996935c.zip |
populated rmpasswd data via passwd call
-rw-r--r-- | usr/bin/rmpasswd | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/usr/bin/rmpasswd b/usr/bin/rmpasswd index d36b8d1..00dd2e7 100644 --- a/usr/bin/rmpasswd +++ b/usr/bin/rmpasswd @@ -1,10 +1,6 @@ #!/bin/bash while read p; do - delim=$(echo $p | tr ":" " ") - read -a arr <<< $delim - if [[ ${arr[1]} == "$"* ]] - then - passwd -d ${arr[0]} - fi -done < /etc/shadow
\ No newline at end of file + read -a arr <<< $p + passwd -d ${arr[0]} +done <<< "$(passwd -Sa |egrep '^[^[:space:]]+[[:space:]]P[[:space:]]')" |