diff options
author | ramon <ramongomez@us.es> | 2014-07-08 11:47:54 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2014-07-08 11:47:54 +0000 |
commit | eeb438a111c19ac28cacff08459a1b9a5e4d99e9 (patch) | |
tree | 36e85eda54968949c5c70b986bae6dc1dbdff9e5 /installer | |
parent | eb7b39dc1d44f7ffa5c2c0a51dbc23577a17ee1d (diff) |
#547: Adaptar detección de distribución GNU/Linux en scripts de instalación y de arranque/parada de procesos.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4326 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'installer')
-rwxr-xr-x | installer/opengnsys_update.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index da45b703..14455c87 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -91,12 +91,19 @@ function autoConfigure() { local i -# Detectar sistema operativo del servidor (debe soportar LSB). -OSDISTRIB=$(lsb_release -is 2>/dev/null) +# Detectar sistema operativo del servidor (compatible con fichero os-release y con LSB). +if [ -f /etc/os-release ]; then + source /etc/os-release + OSDISTRIB="$ID" +else + OSDISTRIB=$(lsb_release -is 2>/dev/null) +fi +# Convertir a minúsculas para evitar errores. +OSDISTRIB="${OSDISTRIB,,}" # Configuración según la distribución de Linux. case "$OSDISTRIB" in - Ubuntu|Debian|LinuxMint) + ubuntu|debian|linuxmint) DEPENDENCIES=( php5-ldap xinetd rsync btrfs-tools procps arp-scan ) UPDATEPKGLIST="apt-get update" INSTALLPKGS="apt-get -y install --force-yes" @@ -113,7 +120,7 @@ case "$OSDISTRIB" in APACHEGROUP="www-data" INETDCFGDIR=/etc/xinetd.d ;; - Fedora|CentOS) + fedora|centos) DEPENDENCIES=( php-ldap xinetd rsync btrfs-progs procps-ng arp-scan ) INSTALLPKGS="yum install -y" CHECKPKG="rpm -q --quiet \$package" |