summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_installer.sh
diff options
context:
space:
mode:
Diffstat (limited to 'installer/opengnsys_installer.sh')
-rwxr-xr-xinstaller/opengnsys_installer.sh58
1 files changed, 26 insertions, 32 deletions
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh
index 02ec3cad..a1586067 100755
--- a/installer/opengnsys_installer.sh
+++ b/installer/opengnsys_installer.sh
@@ -132,7 +132,7 @@ function globalSetup ()
else
REMOTE=1
fi
- BRANCH="opengnsys-1.1.1c"
+ BRANCH="master"
CODE_URL="https://codeload.github.com/opengnsys/OpenGnsys/zip/$BRANCH"
API_URL="https://api.github.com/repos/opengnsys/OpenGnsys"
@@ -189,7 +189,7 @@ OSVERSION="${OSVERSION%%.*}"
# Configuración según la distribución GNU/Linux (usar minúsculas).
case "$OSDISTRIB" in
ubuntu|debian|linuxmint)
- DEPENDENCIES=( subversion apache2 php php-ldap php-fpm mysql-server php-mysql isc-dhcp-server bittorrent tftp-hpa tftpd-hpa xinetd build-essential g++-multilib libmysqlclient-dev wget curl doxygen graphviz bittornado ctorrent samba rsync unzip netpipes debootstrap schroot squashfs-tools btrfs-tools procps arp-scan realpath php-curl gettext moreutils jq wakeonlan udpcast libev-dev libjansson-dev libssl-dev shim-signed grub-efi-amd64-signed gawk libdbi-dev libdbi1 libdbd-mysql)
+ DEPENDENCIES=( subversion apache2 php php-ldap php-fpm mysql-server php-mysql isc-dhcp-server bittorrent tftp-hpa tftpd-hpa xinetd build-essential g++-multilib libmysqlclient-dev wget curl doxygen graphviz bittornado ctorrent samba rsync unzip netpipes debootstrap schroot squashfs-tools btrfs-tools procps arp-scan realpath php-curl gettext moreutils jq wakeonlan udpcast libev-dev libjansson-dev libssl-dev shim-signed grub-efi-amd64-signed gawk libdbi-dev libdbi1 libdbd-mysql automake)
UPDATEPKGLIST="apt-get update"
INSTALLPKG="apt-get -y install --force-yes"
CHECKPKG="dpkg -s \$package 2>/dev/null | grep Status | grep -qw install"
@@ -227,7 +227,7 @@ case "$OSDISTRIB" in
TFTPCFGDIR=/var/lib/tftpboot
;;
fedora|centos)
- DEPENDENCIES=( subversion httpd mod_ssl php-ldap php-fpm mysql-server mysql-devel mysql-devel.i686 php-mysql dhcp tftp-server tftp xinetd binutils gcc gcc-c++ glibc-devel glibc-devel.i686 glibc-static glibc-static.i686 libstdc++-devel.i686 make wget curl doxygen graphviz ctorrent samba samba-client rsync unzip debootstrap schroot squashfs-tools python-crypto arp-scan procps-ng gettext moreutils jq net-tools udpcast libev-devel jansson-devel openssl-devel shim-x64 grub2-efi-x64 grub2-efi-x64-modules gawk libdbi-devel libdbi libdbi-dbd-mysql http://ftp.altlinux.org/pub/distributions/ALTLinux/5.1/branch/$(arch)/RPMS.classic/netpipes-4.2-alt1.$(arch).rpm )
+ DEPENDENCIES=( subversion httpd mod_ssl php-ldap php-fpm mysql-server mysql-devel mysql-devel.i686 php-mysql dhcp tftp-server tftp xinetd binutils gcc gcc-c++ glibc-devel glibc-devel.i686 glibc-static glibc-static.i686 libstdc++-devel.i686 make wget curl doxygen graphviz ctorrent samba samba-client rsync unzip debootstrap schroot squashfs-tools python-crypto arp-scan procps-ng gettext moreutils jq net-tools udpcast libev-devel jansson-devel openssl-devel shim-x64 grub2-efi-x64 grub2-efi-x64-modules gawk libdbi-devel libdbi libdbi-dbd-mysql automake http://ftp.altlinux.org/pub/distributions/ALTLinux/5.1/branch/$(arch)/RPMS.classic/netpipes-4.2-alt1.$(arch).rpm )
[ "$OSDISTRIB" == "centos" ] && UPDATEPKGLIST="yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$OSVERSION.noarch.rpm http://rpms.remirepo.net/enterprise/remi-release-$OSVERSION.rpm"
INSTALLEXTRADEPS=( 'pushd /tmp; wget -t3 http://ftp.acc.umu.se/mirror/bittornado/BitTornado-0.3.18.tar.gz && tar xvzf BitTornado-0.3.18.tar.gz && cd BitTornado-CVS && python setup.py install && ln -fs btlaunchmany.py /usr/bin/btlaunchmany && ln -fs bttrack.py /usr/bin/bttrack; popd' )
INSTALLPKG="yum install -y libstdc++ libstdc++.i686"
@@ -1328,30 +1328,12 @@ function servicesCompilation ()
# Compilar OpenGnsys Server
echoAndLog "${FUNCNAME}(): Compiling OpenGnsys Admin Server"
pushd $WORKDIR/opengnsys/admin/Sources/Services/ogAdmServer
- make && mv ogAdmServer $INSTALL_TARGET/sbin
+ autoreconf -fi && ./configure && make && mv ogAdmServer $INSTALL_TARGET/sbin
if [ $? -ne 0 ]; then
echoAndLog "${FUNCNAME}(): error while compiling OpenGnsys Admin Server"
hayErrores=1
fi
popd
- # Compilar OpenGnsys Agent
- echoAndLog "${FUNCNAME}(): Compiling OpenGnsys Agent"
- pushd $WORKDIR/opengnsys/admin/Sources/Services/ogAdmAgent
- make && mv ogAdmAgent $INSTALL_TARGET/sbin
- if [ $? -ne 0 ]; then
- echoAndLog "${FUNCNAME}(): error while compiling OpenGnsys Agent"
- hayErrores=1
- fi
- popd
- # Compilar OpenGnsys Client
- echoAndLog "${FUNCNAME}(): Compiling OpenGnsys Admin Client"
- pushd $WORKDIR/opengnsys/admin/Sources/Clients/ogAdmClient
- make && mv ogAdmClient ../../../../client/shared/bin
- if [ $? -ne 0 ]; then
- echoAndLog "${FUNCNAME}(): error while compiling OpenGnsys Admin Client"
- hayErrores=1
- fi
- popd
return $hayErrores
}
@@ -1406,6 +1388,21 @@ function copyClientFiles()
errorAndLog "${FUNCNAME}(): client copy files with errors"
fi
+ local ogclientUrl="https://codeload.github.com/opengnsys/ogClient/zip/$BRANCH"
+
+ echoAndLog "${FUNCNAME}(): downloading ogClient code..."
+
+ if ! (curl "${ogclientUrl}" -o ogclient.zip && \
+ unzip -qo ogclient.zip && \
+ mv "ogClient-$BRANCH" $INSTALL_TARGET/client/ogClient)
+ then
+ errorAndLog "${FUNCNAME}(): "\
+ "error getting ogClient code from ${ogclientUrl}"
+ return 1
+ fi
+ rm -f ogclient.zip
+ echoAndLog "${FUNCNAME}(): ogClient code was downloaded"
+
return $errstatus
}
@@ -1464,6 +1461,8 @@ function openGnsysConfigure()
echoAndLog "${FUNCNAME}(): Copying init files."
cp -a $WORKDIR/opengnsys/admin/Sources/Services/opengnsys.init /etc/init.d/opengnsys
+ cp -a $WORKDIR/opengnsys/admin/Sources/Services/opengnsys.service \
+ /lib/systemd/system/opengnsys.service
cp -a $WORKDIR/opengnsys/admin/Sources/Services/opengnsys.default /etc/default/opengnsys
# Deshabilitar servicios de BitTorrent si no están instalados.
if [ ! -e /usr/bin/bttrack ]; then
@@ -1493,11 +1492,6 @@ function openGnsysConfigure()
$WORKDIR/opengnsys/admin/Sources/Services/ogAdmServer/ogAdmServer.cfg > $INSTALL_TARGET/etc/ogAdmServer-$dev.cfg
sed -e "s/SERVERIP/${SERVERIP[i]}/g" \
$WORKDIR/opengnsys/repoman/etc/ogAdmRepo.cfg.tmpl > $INSTALL_TARGET/etc/ogAdmRepo-$dev.cfg
- sed -e "s/SERVERIP/${SERVERIP[i]}/g" \
- -e "s/DBUSER/$OPENGNSYS_DB_USER/g" \
- -e "s/DBPASSWORD/$OPENGNSYS_DB_PASSWD/g" \
- -e "s/DATABASE/$OPENGNSYS_DATABASE/g" \
- $WORKDIR/opengnsys/admin/Sources/Services/ogAdmAgent/ogAdmAgent.cfg > $INSTALL_TARGET/etc/ogAdmAgent-$dev.cfg
CONSOLEURL="https://${SERVERIP[i]}/opengnsys"
sed -e "s/SERVERIP/${SERVERIP[i]}/g" \
-e "s/DBUSER/$OPENGNSYS_DB_USER/g" \
@@ -1505,19 +1499,15 @@ function openGnsysConfigure()
-e "s/DATABASE/$OPENGNSYS_DATABASE/g" \
-e "s/OPENGNSYSURL/${CONSOLEURL//\//\\/}/g" \
$INSTALL_TARGET/www/controlacceso.php > $INSTALL_TARGET/www/controlacceso-$dev.php
- sed -e "s/SERVERIP/${SERVERIP[i]}/g" \
- -e "s/OPENGNSYSURL/${CONSOLEURL//\//\\/}/g" \
- $WORKDIR/opengnsys/admin/Sources/Clients/ogAdmClient/ogAdmClient.cfg > $INSTALL_TARGET/client/etc/ogAdmClient-$dev.cfg
if [ "$dev" == "$DEFAULTDEV" ]; then
OPENGNSYS_CONSOLEURL="$CONSOLEURL"
+ OPENGNSYS_SERVERIP="${SERVERIP[i]}"
fi
fi
let i++
done
ln -f $INSTALL_TARGET/etc/ogAdmServer-$DEFAULTDEV.cfg $INSTALL_TARGET/etc/ogAdmServer.cfg
ln -f $INSTALL_TARGET/etc/ogAdmRepo-$DEFAULTDEV.cfg $INSTALL_TARGET/etc/ogAdmRepo.cfg
- ln -f $INSTALL_TARGET/etc/ogAdmAgent-$DEFAULTDEV.cfg $INSTALL_TARGET/etc/ogAdmAgent.cfg
- ln -f $INSTALL_TARGET/client/etc/ogAdmClient-$DEFAULTDEV.cfg $INSTALL_TARGET/client/etc/ogAdmClient.cfg
ln -f $INSTALL_TARGET/www/controlacceso-$DEFAULTDEV.php $INSTALL_TARGET/www/controlacceso.php
# Configuración del motor de clonación.
@@ -1551,6 +1541,10 @@ EOT
echoAndLog "${FUNCNAME}(): Starting OpenGnsys services."
$STARTSERVICE
fi
+
+ echoAndLog "${FUNCNAME}(): Creating ogClient config files."
+ sed -i -e "s/127\.0\.0\.1/$OPENGNSYS_SERVERIP/g" \
+ $INSTALL_TARGET/client/ogClient/cfg/ogclient.json
}