Skip to content

Commit

Permalink
prevent empty rwho lines
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmyczko authored Oct 30, 2024
1 parent b2cf818 commit fd82866
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ruptime
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,13 @@ done)
u=$(printf "%-28s %s %s\n" "$k" "$ac" "$nu" | openssl enc -A -a -aes-192-cbc -pbkdf2 -pass env:KEY -in - -out -)
;;
rwho)
w=$(who |sed "s/ [a-zA-Z:]/ $(eval "$HOSTNAMECMD"):&/1;s,: ,:,1")
u=$(printf "%s\n" "$w" | openssl enc -A -a -aes-192-cbc -pbkdf2 -pass env:KEY -in - -out -)
w=$(who |sed "s/ [a-zA-Z:]/ $(eval "$HOSTNAMECMD"):&/1;s,: ,:,1")
wl=$(echo -n "$w"|wc -l)
if [ ${wl} != 0 ]; then
u=$(printf "%s\n" "$w" | openssl enc -A -a -aes-192-cbc -pbkdf2 -pass env:KEY -in - -out -)
else
exit 0
fi
;;
rbench)
dt=date
Expand Down

0 comments on commit fd82866

Please sign in to comment.