addet docker script
This commit is contained in:
parent
2d34c2e7e6
commit
8e108f45d7
3 changed files with 113 additions and 64 deletions
|
@ -13,17 +13,29 @@ choose_installation() {
|
|||
read -r CHOICE
|
||||
|
||||
case "$CHOICE" in
|
||||
1) INSTALL_DOCKER=1; INSTALL_COMPOSE=0 ;;
|
||||
2) INSTALL_DOCKER=0; INSTALL_COMPOSE=1 ;;
|
||||
3) INSTALL_DOCKER=1; INSTALL_COMPOSE=1 ;;
|
||||
*) printf "%b\n" "${RED}Invalid choice. Exiting.${RC}"; exit 1 ;;
|
||||
1)
|
||||
INSTALL_DOCKER=1
|
||||
INSTALL_COMPOSE=0
|
||||
;;
|
||||
2)
|
||||
INSTALL_DOCKER=0
|
||||
INSTALL_COMPOSE=1
|
||||
;;
|
||||
3)
|
||||
INSTALL_DOCKER=1
|
||||
INSTALL_COMPOSE=1
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Invalid choice. Exiting.${RC}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
install_docker() {
|
||||
printf "%b\n" "${YELLOW}Installing Docker...${RC}"
|
||||
case "$PACKAGER" in
|
||||
apt-get|nala)
|
||||
apt-get | nala)
|
||||
curl -fsSL https://get.docker.com | sh
|
||||
;;
|
||||
zypper)
|
||||
|
@ -46,7 +58,7 @@ install_docker() {
|
|||
install_docker_compose() {
|
||||
printf "%b\n" "${YELLOW}Installing Docker Compose...${RC}"
|
||||
case "$PACKAGER" in
|
||||
apt-get|nala)
|
||||
apt-get | nala)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin
|
||||
;;
|
||||
zypper)
|
||||
|
@ -82,6 +94,36 @@ install_components() {
|
|||
fi
|
||||
}
|
||||
|
||||
init_groups() {
|
||||
clear
|
||||
if command_exists usermod; then
|
||||
printf "%b\n" "${YELLOW}Do you want to add $(whoami) to the docker group?:${RC}"
|
||||
printf "%b" "Enter your choice [Y/n]: "
|
||||
read -r CHOICE_2
|
||||
|
||||
case "$CHOICE_2" in
|
||||
N | n)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" usermod -aG docker "$(whoami)"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
printf "%b\n" "${RED}The command 'usermod' does not exist!${RC}"
|
||||
fi
|
||||
}
|
||||
|
||||
setup_autostart() {
|
||||
if command_exists systemctl; then
|
||||
"$ESCALATION_TOOL" systemctl enable --now docker
|
||||
else
|
||||
printf "%b\n" "${RED}The command 'systemctl' does not exist!${RC}"
|
||||
fi
|
||||
}
|
||||
|
||||
checkEnv
|
||||
checkEscalationTool
|
||||
install_components
|
||||
init_groups
|
||||
|
||||
|
|
|
@ -13,6 +13,12 @@ description = "Flatpak is a universal application sandbox for Linux that uses is
|
|||
script = "setup-flatpak.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data]]
|
||||
name = "Docker"
|
||||
description = "Installs docker and handles the group permissions correctly"
|
||||
script = "docker-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data]]
|
||||
name = "github-desktop"
|
||||
description = "GitHub Desktop is a free Git client that allows you to manage your GitHub repositories on your desktop."
|
||||
|
|
|
@ -30,7 +30,8 @@ task_list = "I"
|
|||
[[data.entries]]
|
||||
name = "Blackarch setup"
|
||||
description = "You can install blackarch repositories and packages through this script, if your on arch already (which you should, if you're seeing this)"
|
||||
script = "arch/blackarch.sh" = "I"
|
||||
script = "arch/blackarch.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data]]
|
||||
name = "Debian"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue