Skip to content

Commit

Permalink
Detección de Distro
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Quintero committed Aug 19, 2022
1 parent 22695dc commit a35fb5e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Modulos del pipline

install:
./bin/install.sh
test:
./bin/test.sh
sra2fq:
Expand Down
26 changes: 26 additions & 0 deletions bin/install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
#!/bin/bash
echo "Detectando Distro Linux"

printf "\nPrimer script busca archivos especificos a cada distro\n"
# Fedora/RHEL/CentOS distro
if [ -f /etc/redhat-release ]; then
echo "FED"
# Debian/Ubuntu
elif [ -r /lib/lsb/init-functions ]; then
echo "DEB"
elif [ -f /etc/arch-release ]; then
echo "ARCH"
fi
printf "\n"
## Otra prueba de script
printf "Segundo script de prueba usa /etc/os-release\n"
DISTRIB=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
if [[ ${DISTRIB} = "Ubuntu"* ]]; then
if uname -a | grep -q '^Linux.*Microsoft'; then
# ubuntu via WSL Windows Subsystem for Linux
echo "Windows Subsystem for Linux"
else
# Native Ubuntu
echo "Ubuntu"
fi
elif [[ ${DISTRIB} = '"Debian"'* ]]; then
echo "Debian"
elif [[ ${DISTRIB} = '"Pop!_OS"'* ]]; then
echo "Pop! OS"
fi

# Este archivo es el que me va a servir
printf "\nEste archivo es el que va a servir, probar con maquinas virtuales /etc/os-release\n"
printf "Pues al filtrar nos daria algo como esto: "$(awk -F= '/^NAME/{print $2}' /etc/os-release)"\n"

0 comments on commit a35fb5e

Please sign in to comment.