From d8c750c0968173444ac5c16af9ec8f1f7996935c Mon Sep 17 00:00:00 2001 From: Patrick Murphy Date: Mon, 18 May 2020 15:19:06 -0500 Subject: populated rmpasswd data via passwd call --- usr/bin/rmpasswd | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'usr/bin/rmpasswd') 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:]]')" -- cgit v1.2.3