04-change-gids-and-uids 565 Bytes
Newer Older
1
2
3
4
#!/bin/sh

set -e

5
# Free the fixed GIDs and UIDs we're using.
6

7
echo "Change GIDs and UIDs"
8
9
10
11
12
13

TPS_GROUP_STEALER=$(getent group 122 | awk -F ':' '{print $1}')
if [ -n "$TPS_GROUP_STEALER" ]; then
   groupmod --gid 150 "$TPS_GROUP_STEALER"
   find / -wholename /proc -prune -o \( \! -type l -a -gid 122 -exec chgrp 150 '{}' \; \)
fi
14
15
16
17

TPS_USER_STEALER=$(getent passwd 115 | awk -F ':' '{print $1}')
if [ -n "$TPS_USER_STEALER" ]; then
   usermod --uid 150 "$TPS_USER_STEALER"
18
   find / -wholename /proc -prune -o \( \! -type l -a -uid 115 -exec chown 150 '{}' \; \)
19
fi