diff options
author | 2021-02-10 09:44:27 +0200 | |
---|---|---|
committer | 2021-02-10 13:11:34 +0200 | |
commit | b445c58ef8f61c4794da60af3ab18b3fec33f78c (patch) | |
tree | cfef47c59c289e58ff9ad315ccf183074dcb36f0 /bin | |
parent | uid-gid.txt: update GUID/UID status for jenkins (diff) | |
download | api-b445c58ef8f61c4794da60af3ab18b3fec33f78c.tar.gz api-b445c58ef8f61c4794da60af3ab18b3fec33f78c.tar.bz2 api-b445c58ef8f61c4794da60af3ab18b3fec33f78c.zip |
used_free_uidgids.sh: Also count the free UID+GID pairs.
Signed-off-by: Jaco Kroon <jaco@iewc.co.za>
Closes: https://github.com/gentoo/api-gentoo-org/pull/367
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/used_free_uidgids.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/used_free_uidgids.sh b/bin/used_free_uidgids.sh index 3b43ac9..24cd682 100755 --- a/bin/used_free_uidgids.sh +++ b/bin/used_free_uidgids.sh @@ -174,6 +174,7 @@ gi=0 # index into gids array. idbase=0 # "start" of range about to be output. freeuid=0 # count number of free UIDs freegid=0 # count number of free GIDs +freepair=0 # count number of free UID+GID pairs. printf "%-*s%10s%10s\n" $(( ${#max} * 2 + 5 )) "#ID" UID GID @@ -238,6 +239,7 @@ while [[ ${idbase} -le ${max} ]]; do if [[ "${gidstate}" == FREE ]]; then if [[ "${uidstate}" == FREE ]]; then uidgidboth=${re} + freepair=$(( freepair + re - idbase + 1 )) else gidonly=${re} fi @@ -258,3 +260,4 @@ echo "Recommended UID only: ${uidonly:=${uidgidboth:-none}}" echo "Recommended UID+GID both: ${uidgidboth:-none}" echo "Free UIDs: ${freeuid}" echo "Free GIDs: ${freegid}" +echo "Free UID+GID pairs: ${freepair}" |