feat: fix all Ubuntu container issues
This commit is contained in:
parent
a60dd9ab7d
commit
635d085943
1 changed files with 9 additions and 1 deletions
|
@ -318,7 +318,15 @@ if ! grep -q "^${_uname}:" /etc/group; then
|
|||
printf "%s:x:%s:" "$_uname" "$_cgid" >> /etc/group
|
||||
fi
|
||||
fi
|
||||
if [[ $_cuid -eq 1000 ]] && grep -q ubuntu /etc/passwd; then
|
||||
userdel -r ubuntu &>/dev/null
|
||||
groupdel ubuntu &> /dev/null
|
||||
grep -v ubuntu /etc/passwd > /etc/passwd.tmp
|
||||
grep -v ubuntu /etc/group > /etc/group.tmp
|
||||
mv /etc/passwd.tmp /etc/passwd
|
||||
mv /etc/group.tmp /etc/group
|
||||
echo -e '\n'"$_uname"':x:1000\n' >> /etc/group
|
||||
fi
|
||||
useradd --uid "$_cuid" --gid "$_cgid" --shell "/bin/bash" --no-create-home --home "$_uhome" "$_uname" &>/dev/null
|
||||
|
||||
chown root /etc/sudo.conf
|
||||
|
|
Loading…
Reference in a new issue