summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/vyatta-first-login-passwd.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/vyatta-first-login-passwd.sh b/scripts/vyatta-first-login-passwd.sh
index d75e5c0c..ab4e8ed4 100755
--- a/scripts/vyatta-first-login-passwd.sh
+++ b/scripts/vyatta-first-login-passwd.sh
@@ -91,14 +91,17 @@ change_password() {
save
}
+dpwd='"*"'
for user in $($API listEffectiveNodes system login user); do
user=${user//\'/}
epwd=$(show system login user $user authentication encrypted-password)
epwd=$(awk '{ print $2 }' <<<$epwd)
- salt=$(awk 'BEGIN{ FS="$" }; { print $3 }' <<<$epwd)
- vyatta_epwd=$(mkpasswd -H md5 -S $salt vyatta)
- if [[ $epwd == $vyatta_epwd ]]; then
- change_password $user
+ if [[ $epwd != $dpwd ]]; then
+ salt=$(awk 'BEGIN{ FS="$" }; { print $3 }' <<<$epwd)
+ vyatta_epwd=$(mkpasswd -H md5 -S $salt vyatta)
+ if [[ $epwd == $vyatta_epwd ]]; then
+ change_password $user
+ fi
fi
done
eval $(exit_configure)