From da4d21ecddcdd7ca278c027a98bf87d4b76dcf8e Mon Sep 17 00:00:00 2001 From: WickedYoda <68271168+wickedyoda@users.noreply.github.com> Date: Sun, 31 Mar 2024 15:38:11 -0500 Subject: [PATCH] sdfsd dsfsdf --- server_config/ubuntu/ubuntu-docker-install.sh | 29 ++++++++++++++ server_config/ubuntu/ubuntu-setup.sh | 3 ++ update-public-setupfiles | 39 +++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 server_config/ubuntu/ubuntu-docker-install.sh create mode 100644 update-public-setupfiles diff --git a/server_config/ubuntu/ubuntu-docker-install.sh b/server_config/ubuntu/ubuntu-docker-install.sh new file mode 100644 index 0000000..7a73639 --- /dev/null +++ b/server_config/ubuntu/ubuntu-docker-install.sh @@ -0,0 +1,29 @@ +for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done +# Remove docker.io, docker-doc, docker-compose, podman-docker, containerd, runc +sudo apt-get purge docker.io docker-doc docker-compose podman-docker containerd runc + +# update repos +sudo apt-get update + +# install dependencies +sudo apt-get install ca-certificates curl -y +sudo install -m 0755 -d /etc/apt/trusted.gpg.d +sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg + +# Add docker repo to apt/sources.list.d +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/docker.gpg] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + +# run apt update +sudo apt-get update + +# Install docker and docker-compose +sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y + +# adduser traver to docker +sudo adduser $USER docker + +# echo done +echo "Install complete, please reboot" \ No newline at end of file diff --git a/server_config/ubuntu/ubuntu-setup.sh b/server_config/ubuntu/ubuntu-setup.sh index 44e81a9..b424302 100644 --- a/server_config/ubuntu/ubuntu-setup.sh +++ b/server_config/ubuntu/ubuntu-setup.sh @@ -6,6 +6,9 @@ apt-get update -y # add traver sudo adduser traver sudo +# uninstall ufm +apt remove ufw -y + # install open-vm-tools apt-get install open-vm-tools -y diff --git a/update-public-setupfiles b/update-public-setupfiles new file mode 100644 index 0000000..19e5e2c --- /dev/null +++ b/update-public-setupfiles @@ -0,0 +1,39 @@ + +# Change to /home/traver +cd /home/traver + +# Check distro and download updated public-setupfiles +if [ -f "/etc/debian_version" ]; then + # Pull file A + wget https://raw.githubusercontent.com/wickedyoda/public-setupfiles/main/server_config/ubuntu/ubuntu-setup.sh +elif [ -f "/etc/lsb-release" ]; then + # Pull file B + wget https://raw.githubusercontent.com/wickedyoda/public-setupfiles/main/server_config/debian/debian-setup.sh +fi + +# make updated files executable +cd /home/traver +chmod +x ./ubuntu-setup.sh +chmod +x ./debian-setup.sh + +# Check if /home/traver/public-setupfiles exists +if [ -d "/home/traver/public-setupfiles" ]; then + # Change directory to /home/traver/public-setupfiles + cd /home/traver/public-setupfiles + + # Stash any local changes + git stash + + # Pull the latest changes from the remote repository + git pull +else + # mkdir for git repo + sudo mkdir -p /home/traver/public-setupfiles + cd /home/traver/public-setupfiles + git init + git remote add origin https://github.com/wickedyoda/public-setupfiles + git pull origin main + git checkout main + +# make directory executable +chmod +x -R /home/traver/public-setupfiles \ No newline at end of file