diff options
-rwxr-xr-x | admin/Sources/Services/opengnsys.init | 7 | ||||
-rwxr-xr-x | installer/opengnsys_update.sh | 15 |
2 files changed, 15 insertions, 7 deletions
diff --git a/admin/Sources/Services/opengnsys.init b/admin/Sources/Services/opengnsys.init index 359a3166..2912811e 100755 --- a/admin/Sources/Services/opengnsys.init +++ b/admin/Sources/Services/opengnsys.init @@ -82,12 +82,13 @@ fi config() { if [ -f /etc/os-release ]; then source /etc/os-release - OSDISTRIB="$NAME" + OSDISTRIB="$ID" else OSDISTRIB=$(lsb_release -is 2>/dev/null) fi + OSDISTRIB="${OSDISTRIB,,}" case "$OSDISTRIB" in - Ubuntu|Debian|LinuxMint) + ubuntu|debian|linuxmint) INITFUNCTIONS=/lib/lsb/init-functions DAEMONSTART="start-stop-daemon --start --quiet --background --exec" EXTRAOPTS="--" @@ -101,7 +102,7 @@ config() { SEEDERSTART="start-stop-daemon --make-pidfile --pidfile $BTSEEDERPID --start --quiet --background --exec" SEEDERSTOP="start-stop-daemon --stop --quiet --oknodo --pidfile $BTSEEDERPID" ;; - CentOS|Fedora) + centos|fedora) INITFUNCTIONS=/etc/init.d/functions DAEMONSTART="daemon" ENDOPTS="&" 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" |