04-change-gids-and-uids 565 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. set -e
  3. # Free the fixed GIDs and UIDs we're using.
  4. echo "Change GIDs and UIDs"
  5. TPS_GROUP_STEALER=$(getent group 122 | awk -F ':' '{print $1}')
  6. if [ -n "$TPS_GROUP_STEALER" ]; then
  7. groupmod --gid 150 "$TPS_GROUP_STEALER"
  8. find / -wholename /proc -prune -o \( \! -type l -a -gid 122 -exec chgrp 150 '{}' \; \)
  9. fi
  10. TPS_USER_STEALER=$(getent passwd 115 | awk -F ':' '{print $1}')
  11. if [ -n "$TPS_USER_STEALER" ]; then
  12. usermod --uid 150 "$TPS_USER_STEALER"
  13. find / -wholename /proc -prune -o \( \! -type l -a -gid 115 -exec chgrp 150 '{}' \; \)
  14. fi