Merge "Addressng chsh fail due to /etc/passwd permissions"

This commit is contained in:
Zuul 2019-05-23 20:55:22 +00:00 committed by Gerrit Code Review
commit 65b885a10d
1 changed files with 17 additions and 2 deletions

View File

@ -36,6 +36,21 @@ then
chmod 600 ~maas/.ssh/*
fi
chsh -s /bin/bash maas
set +e
sh_set=false
for (( c=0; c<=10; c++ )); do
if chsh -s /bin/bash maas; then
sh_set=true
break
elif usermod -s /bin/bash maas; then
sh_set=true
break
else
sleep 2
fi
done
if [[ $sh_set = false ]]; then
exit 1
fi
set -e
exec /sbin/init --log-target=console 3>&1