Skip to content

Commit

Permalink
used_free_uidgids.sh: Make the recommended IDs stand out
Browse files Browse the repository at this point in the history
By moving this output to the end and adding some colour.

Signed-off-by: Ulrich Müller <[email protected]>
  • Loading branch information
ulm committed Nov 15, 2021
1 parent fb1e376 commit 858cf06
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bin/used_free_uidgids.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,14 @@ for r in "${selection_ranges[@]}"; do
(( free_total_pair += freepair ))
done

echo "Recommended GID only: ${gidonly:-${uidgidboth:-none}}"
echo "Recommended UID only: ${uidonly:=${uidgidboth:-none}}"
echo "Recommended UID+GID pair: ${uidgidboth:-none}"
echo "Free UIDs: ${free_total_uid}"
echo "Free GIDs: ${free_total_gid}"
echo "Free UID+GID pairs: ${free_total_pair}"
echo

for out in "Recommended GID only: ${gidonly:-${uidgidboth:-none}}" \
"Recommended UID only: ${uidonly:-${uidgidboth:-none}}" \
"Recommended UID+GID pair: ${uidgidboth:-none}"; do
[[ ${out} == *none ]] && colour=${colour_USED} || colour=${colour_FREE}
echo -e "${out%%: *}: ${colour}${out#*: }${colour_RESET}"
done

0 comments on commit 858cf06

Please sign in to comment.