Skip to content
Snippets Groups Projects
Commit b6a0cad3 authored by Erik Alexandre Pucci's avatar Erik Alexandre Pucci
Browse files

Merge branch 'v1.3.14-rc'


Conflicts:
	README
	client/conf/version
	client/lib/Makefile
	collect/scripts/collect/inep/number.int
	collect/scripts/collect/mac-address.tree
	collect/scripts/collect/mac-address/number.string
	scripts/collect/inep/number.int

Signed-off-by: default avatarErik Alexandre Pucci <eap08@c3sl.ufpr.br>
parents 5ec91fdf 2833856e
Branches
Tags v1.4.0
No related merge requests found
......@@ -153,9 +153,14 @@ LOGFILE=/tmp/collected-information.log
# Save stdout to file descriptor 3 and redirect all output to $LOGFILE
exec 3>&1 &> ${LOGFILE}
# Remove any previous installation of the agent
rm -rf "${AGENT_DIR}"
/usr/sbin/userdel -r seed_mec
/usr/sbin/groupdel seed_mec
# Create seed_mec group and exit on error (except by the error of previous
# existence of seed_mec group)
if ! groupadd -f seed_mec; then
if ! /usr/sbin/groupadd -f seed_mec; then
printf "ERRO: Falha ao criar o grupo seed_mec.\n"
exit 1
fi
......@@ -169,7 +174,7 @@ TMPSKEL=$(mktemp -d)
# Create seed_mec user with seed_mec as group, BASH as default shell,
# $SEED_MEC_HOME as home and $TMPSKEL as temporary skel
useradd -m -g seed_mec -s /bin/bash -d "${SEED_MEC_HOME}" \
/usr/sbin/useradd -m -g seed_mec -s /bin/bash -d "${SEED_MEC_HOME}" \
-k "${TMPSKEL}" seed_mec
RETVAL=$?
......@@ -184,6 +189,9 @@ fi
# Remove the temporary skel, as it isn't needed anymore
rmdir "${TMPSKEL}"
# Ensure seed_mec's home exists
mkdir -p "${SEED_MEC_HOME}"
# Remove old crontab of seed_mec, in case there's one, avoinding a specific
# error of wrong owner/lack of permissions
crontab -u seed_mec -r
......
......@@ -102,7 +102,9 @@ if test "${ERROR}" -eq 0; then
# Copy or create the md5 files from inep and proxy
(test -d "${SEED_MEC_HOME}/SEED2/.md5sum" &&
cp -a "${SEED_MEC_HOME}/SEED2/.md5sum/client/conf/"{inep,proxy} \
"${SEED_MEC_HOME}/update/tmp/SEED2-run/.md5sum/client/conf/") ||
"${SEED_MEC_HOME}/update/tmp/SEED2-run/.md5sum/client/conf/" &&
cp -a "${SEED_MEC_HOME}/SEED2/.md5sum/.backup/client/conf/"{inep,proxy} \
"${SEED_MEC_HOME}/update/tmp/SEED2-run/.md5sum/.backup/client/conf/") ||
restore_inep_proxy_md5sum
# Copy or create the backup files from inep and proxy
......
......@@ -57,6 +57,7 @@ function tryWget(){
PROXY="http://${phost}:${pport}"
fi
PROXYPASSWD="--proxy-password"
if which wget &> /dev/null; then
WGETBIN="$(which wget)"
WGETVERSION="$(${WGETBIN} --version | head -n1 | cut -d' ' -f3)"
......@@ -67,8 +68,6 @@ function tryWget(){
if test ${WGETVER1} -lt 1 -o ${WGETVER1} -eq 1 -a ${WGETVER2} -lt 10
then
PROXYPASSWD="--proxy-passwd"
else
PROXYPASSWD="--proxy-password"
fi
else
WGETBIN="${PREFIX}/bin/wget"
......
1.1.0
1.4.0
......@@ -16,14 +16,22 @@ win:
@tar xzf $(LIBGSOAP)_$(LIBGSOAPVER).$(LIBGSOAPSVER).tar.gz
soap:
@wget -nc "$(GSOAPDOWNLOADLINK)" -O "$(LIBGSOAP)_$(LIBGSOAPVER).$(LIBGSOAPSVER).tar.gz"
@tar xzf $(LIBGSOAP)_$(LIBGSOAPVER).$(LIBGSOAPSVER).tar.gz
@echo "Installing gSOAP library, wait..."
@cp -f stdsoap2.? $(LIBDIR)/$(LIBGSOAPDIR)/${LIBGSOAP}/
@cd $(LIBDIR)/$(LIBGSOAPDIR) && ./configure -q --prefix=$(PWD)/$(LIBGSOAP) && make
@if ! test -d "$(LIBDIR)/$(LIBGSOAPDIR)"; then\
wget -nc "$(GSOAPDOWNLOADLINK)" -O "$(LIBGSOAP)_$(LIBGSOAPVER).$(LIBGSOAPSVER).tar.gz";\
tar xzf $(LIBGSOAP)_$(LIBGSOAPVER).$(LIBGSOAPSVER).tar.gz;\
echo "Installing gSOAP library, wait...";\
cp -f stdsoap2.? $(LIBDIR)/$(LIBGSOAPDIR)/${LIBGSOAP}/;\
cd $(LIBDIR)/$(LIBGSOAPDIR) && ./configure -q --prefix=$(PWD)/$(LIBGSOAP) && make;\
elif test -d "$(LIBDIR)/$(LIBGSOAPDIR)"; then\
echo "Packages already downloaded";\
fi
install:
@cd $(LIBDIR)/$(LIBGSOAPDIR) && make install
@if ! test -d $(LIBGSOAP); then\
cd $(LIBDIR)/$(LIBGSOAPDIR) && make install;\
elif test -d $(LIBGSOAP); then\
echo "Packages already installed";\
fi
clean:
@cd $(LIBDIR)/$(LIBGSOAPDIR) && make clean
......
......@@ -59,7 +59,7 @@ date +"%F %T" >> ${log}
# Get common functions
source ${dirname}/common.sh
url="--url=http://seed.c3sl.ufpr.br/tomcat/axis/Seed2.jws"
url="--url=http://200.17.202.187/tomcat/axis/Seed2.jws"
inep=$(cat ${dirname}/conf/inep 2> /dev/null)
if test ! -f "${dirname}/conf/inep" -o -z "${inep}"; then
printf "WARNING: inep file not found or empty.\n" >> ${log}
......
......@@ -96,7 +96,7 @@ try_force_update(){
update_myself(){
UPDATETRIES=3
UPDATETIMEOUT=100
UPDATESERVER="http://seed.c3sl.ufpr.br/pacotes/download"
UPDATESERVER="http://200.17.202.187/pacotes/download"
TMPDIR="${PREFIX}/tmp"
# The proxy config itself
......@@ -118,6 +118,7 @@ update_myself(){
fi
fi
PROXYPASSWD="--proxy-password"
if which wget &> /dev/null; then
WGETBIN="$(which wget)"
WGETVERSION="$(${WGETBIN} --version | head -n1 | cut -d' ' -f3)"
......@@ -128,8 +129,6 @@ update_myself(){
if test ${WGETVER1} -lt 1 -o ${WGETVER1} -eq 1 -a ${WGETVER2} -lt 10
then
PROXYPASSWD="--proxy-passwd"
else
PROXYPASSWD="--proxy-password"
fi
else
WGETBIN="${PREFIX}/bin/wget"
......
#!/bin/bash
# Copyright (C) 2004-2009 Centro de Computacao Cientifica e Software Livre
# Copyright (C) 2009-2012 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of collect-agent
......@@ -19,20 +19,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
PATH=${PATH}:/sbin:/usr/sbin
PREFIX="$(dirname $(readlink -f $0))"
# Include getNetworkInterface()
source ${PREFIX}/client/common.sh
cat ${PREFIX}/../../../client/conf/version
# Obtain the network interface in use
getNetworkInterface
MACADDR=$(ifconfig ${interface} | head -n1 | awk '{print $NF}' 2> /dev/null)
MACEXPRESSION="^([a-f0-9]{2}:){5}[a-f0-9]{2}$"
if test -n "$(egrep -i ${MACEXPRESSION} <<< ${MACADDR})"; then
printf "${MACADDR}\n"
else
printf "invalid\n"
exit 1
fi
exit $?
......@@ -94,6 +94,9 @@ if test -d "/dev/disk/by-id/"; then
# If "/proc/mdstat" exists, than check for RAID disks
test -f "/proc/mdstat" && raid=true
# Add scsi to accept machines with only scsi as disk type
diskType="${diskType}\|scsi"
# Verify every disk in "/dev/disk/by-id/", excluding all USB's, unless it's
# the USB used as root by Classmate notebook
for line in $(ls -l --time-style="+%F %R" /dev/disk/by-id/ |
......@@ -104,7 +107,7 @@ if test -d "/dev/disk/by-id/"; then
disks="${disks}<hdd${number}>"
disks="${disks}<model value=\"$(ls -l --time-style="+%F %R"\
/dev/disk/by-id/ | grep "$line$" | awk '{print $8}' | grep "$diskType" |
cut -d"-" -f2-)\" type=\"string\"/>"
head -n 1 | cut -d"-" -f2-)\" type=\"string\"/>"
# Multiply the number of blocks by their standard size
diskSize=$(($(cat /sys/block/$line/size)*512))
......
#!/bin/bash
# Copyright (C) 2009-2012 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of collect-agent
#
# collect-agent is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
while read mac; do
newTag="<mac value=\"$mac\" type=\"string\"/>"
tags="$tags$newTag"
done < <(/sbin/ifconfig 2>&1 | awk '/HW/ {print $NF}' | sort -u)
printf "${tags}\n"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment