test for apt-get

This commit is contained in:
Ray Elliott 2020-03-19 19:11:41 +00:00
parent 59e3fe422d
commit 3fb4ee98f4
1 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,10 @@ chown "$_user": /home/"$_user"/.ssh/authorized_keys
passwd -d "$_user"
chage -d 0 "$_user"
# TODO test apt-get is used
apt-get update && apt-get -y upgrade && apt-get -y install sudo
if command -v apt-get ; then
apt-get update && apt-get -y upgrade && apt-get -y install sudo
else
echo "Error - no package installer found."
fi
# TODO ensure group sudo is allowed sudo