Ignore the user; change group of files inside docker
This commit is contained in:
parent
7e5e2559b0
commit
d76db82aaa
|
@ -10,7 +10,9 @@ if [[ ! -e $1 || ! -e $2 ]]; then
|
||||||
echo "Use groupfile1 as the basis and merges missing entries from groupfile2"
|
echo "Use groupfile1 as the basis and merges missing entries from groupfile2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat $1
|
cat $1 | grep -v ":1000:"
|
||||||
|
# yes, group assignments of the host user will remain, but it won't hurt
|
||||||
|
|
||||||
echo "# merged entries:"
|
echo "# merged entries:"
|
||||||
cat $2 | while read grp; do
|
cat $2 | while read grp; do
|
||||||
name=$(echo $grp | cut -d ':' -f 1)
|
name=$(echo $grp | cut -d ':' -f 1)
|
||||||
|
@ -20,6 +22,10 @@ cat $2 | while read grp; do
|
||||||
|
|
||||||
line=$(cat $1 | grep -E "^$name:")
|
line=$(cat $1 | grep -E "^$name:")
|
||||||
if [[ $line == "" ]]; then
|
if [[ $line == "" ]]; then
|
||||||
echo $name:$pass:$(($dgid + 2000)):$rest
|
ngid=$(($dgid + 2000))
|
||||||
|
echo $name:$pass:$ngid:$rest
|
||||||
|
if [[ -e /.dockerenv ]]; then
|
||||||
|
find / -group $dgid -mount -exec chgrp ngid {} \;
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user