57 lines
1.1 KiB
Bash
57 lines
1.1 KiB
Bash
#! /bin/bash
|
|
function update {
|
|
echo "Updating System"
|
|
apt update && apt upgrade -y
|
|
echo "Update Complete"
|
|
sleep 2
|
|
}
|
|
|
|
function installdocker {
|
|
echo "Installing Docker"
|
|
echo
|
|
sleep 1
|
|
|
|
apt-get install \
|
|
ca-certificates \
|
|
curl \
|
|
gnupg \
|
|
lsb-release
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
|
echo \
|
|
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
|
|
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
apt update
|
|
apt install docker-ce docker-ce-cli containerd.io && echo "Docker has been successfully installed."
|
|
Sleep 1
|
|
}
|
|
|
|
function createuser {
|
|
echo "Creating User"
|
|
sleep 1
|
|
while ($userprompt == "yes" or "y" {
|
|
$user = read -p ("Please enter user name: ")
|
|
}
|
|
|
|
}
|
|
|
|
|
|
##MAIN
|
|
|
|
update
|
|
|
|
$dockerprompt = read -p ("Do you want to install Docker? ")
|
|
if ($dockerprompt == "yes" or "y") {
|
|
installdocker }
|
|
else
|
|
fi
|
|
|
|
|
|
$userprompt = read -p ("Would you like to add a user? ")
|
|
if ($userprompt == "yes" or "y") {
|
|
createuser }
|
|
else
|
|
fi
|
|
|
|
|
|
|