blob: a83baa05da7f66c4e5584f947396b941d66501b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#! /bin/bash
[ -f /etc/subuid ] || exit
[ -f /etc/subgid ] || exit
users=$(getent group ipeusers | awk 'BEGIN { FS=":" } { print $4 }' | sed -e 's/,/\n/')
subuid=$(cat /etc/subuid | awk 'BEGIN { FS=":" } { print $1 }')
subgid=$(cat /etc/subgid | awk 'BEGIN { FS=":" } { print $1 }')
subuid=$(echo -e "$users\n$subuid\n$subuid" | sort | uniq -u)
subgid=$(echo -e "$users\n$subgid\n$subgid" | sort | uniq -u)
for user in $subuid; do
grep -qxF "$user" /etc/subuid || sed -i'' -e "\$a$user:100000:65536" /etc/subuid
done
for user in $subgid; do
grep -qxF "$user" /etc/subgid || sed -i'' -e "\$a$user:100000:65536" /etc/subgid
done
|