From 4409d830fc7d38b2e29d9bb71cb85faf64ca398d Mon Sep 17 00:00:00 2001 From: WickedYoda <68271168+wickedyoda@users.noreply.github.com> Date: Sun, 31 Mar 2024 15:43:01 -0500 Subject: [PATCH] as sa --- update-public-setupfiles.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/update-public-setupfiles.sh b/update-public-setupfiles.sh index 19e5e2c..c9ade37 100644 --- a/update-public-setupfiles.sh +++ b/update-public-setupfiles.sh @@ -3,10 +3,16 @@ cd /home/traver # Check distro and download updated public-setupfiles -if [ -f "/etc/debian_version" ]; then +if [ -x "$(command -v lsb_release)" ]; then + distro=$(lsb_release -si) +else + distro=$(cat /etc/os-release | grep -oP '(?<=^ID=).+' | tr -d '"') +fi + +if [ "$distro" = "Ubuntu" ]; 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 +elif [ "$distro" = "Debian" ]; then # Pull file B wget https://raw.githubusercontent.com/wickedyoda/public-setupfiles/main/server_config/debian/debian-setup.sh fi