Skip to content

Commit

Permalink
restore remote reverse (fixes #2137)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLKwong committed Mar 26, 2021
1 parent 53219ea commit 05c35c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ function remote {
showuser=$(ssh 2fa show $user)
if [[ "$showuser" == "SSH 2FA for $user is disabled." ]]; then
outputpart="\"$user\":\"disabled\","
else
else
secret="$(echo "$showuser" | head -n 1 | sed 's/Secret Key://g' | sed -r 's/\s+//g')"
scratch="$(echo "$showuser" | awk 'NR>3' | sed 's/.*/"&"/' | awk '{printf "%s"",",$0}' | sed 's/,$//')"
outputpart="\"$user\":{\"secret key\":\"$secret\",\"scratch codes\":[$scratch]},"
fi
output="$output$outputpart"
done
done
echo "{${output::-1}}"
;;
"help")
Expand Down

0 comments on commit 05c35c3

Please sign in to comment.