From 87ed969bbc60801f5a549a16e34c0c4d225acc6d Mon Sep 17 00:00:00 2001 From: WickedYoda <68271168+wickedyoda@users.noreply.github.com> Date: Thu, 9 May 2024 15:43:11 -0500 Subject: [PATCH] Update update-public-setupfiles.sh Updates Updates file --- update-public-setupfiles.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/update-public-setupfiles.sh b/update-public-setupfiles.sh index c9ade37..8ccb50b 100644 --- a/update-public-setupfiles.sh +++ b/update-public-setupfiles.sh @@ -3,24 +3,25 @@ cd /home/traver # Check distro and download updated public-setupfiles -if [ -x "$(command -v lsb_release)" ]; then - distro=$(lsb_release -si) +if [ -x "$(command -v os-release)" ]; then + $ID=$(os-release -si) else - distro=$(cat /etc/os-release | grep -oP '(?<=^ID=).+' | tr -d '"') + $ID=$(cat /etc/os-release | grep -oP '(?<=^ID=).+' | tr -d '"') fi -if [ "$distro" = "Ubuntu" ]; then +if [ "$ID" = "Ubuntu" ]; then # Pull file A - wget https://raw.githubusercontent.com/wickedyoda/public-setupfiles/main/server_config/ubuntu/ubuntu-setup.sh -elif [ "$distro" = "Debian" ]; then + wget https://raw.githubusercontent.com/wickedyoda/public-setupfiles/main/server_config/ubuntu/ubuntu-setup.sh && chmod +x ./ubuntu-setup.sh +elif [ "$ID" = "Debian" ]; then # Pull file B - wget https://raw.githubusercontent.com/wickedyoda/public-setupfiles/main/server_config/debian/debian-setup.sh + wget https://raw.githubusercontent.com/wickedyoda/public-setupfiles/main/server_config/debian/debian-setup.sh && chmod +x ./debian-setup.sh +elif [ "$ID" = "raspbian" ]; then + # Pull file B + wget https://raw.githubusercontent.com/wickedyoda/public-setupfiles/main/server_config/debian/debian-setup.sh && chmod +x ./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