Commit 7924fd90 authored by Eduardo L. Buratti's avatar Eduardo L. Buratti

Merge remote-tracking branch 'origin/next'

Signed-off-by: Eduardo L. Buratti's avatarEduardo L. Buratti <elb09@c3sl.ufpr.br>

Conflicts:
	buildpackage/bootstraps/bootstrap-install
	collect/scripts/collect/mirrors-timestamp/timestamp.string
	database/create.sh
	database/create/comment_table.sql
	database/create/create_bd.sh
	database/create/create_control.sql
	database/create/create_dm.sql
	database/create/create_dw.sql
	database/create/create_sa.sql
	database/create/create_user.sql
	database/create/grants_user.sql
	database/create/insert_datas_1.sql
	database/create/insert_datas_2.sql
	database/cron.sh
	database/load/f_load_dm.sql
	database/load/f_load_dw.sql
	database/load/get_month.sql
	database/load/load.sql
	database/load/load_mectb08.sql
	database/load/load_mectb09.sql
	database/load/load_mectb10.sql
	database/load/load_mectb11.sql
	database/load/load_mectb12.sql
parents cdcc1cae c6b28b75
#!/bin/bash
# Copyright (C) 2004-2010 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 buildpackage
......@@ -21,8 +21,8 @@
# This is the installation bootstrap
# This function checks the integrity of tar package
# ------------------------------------------------------------------------------
# This function checks the integrity of the tar package
verify_md5(){
printf "Verificando MD5... " >&3
if [[ ${MD5_CHECK} == $(md5sum ${FILE} | awk '{print $1}') ]] ; then
......@@ -35,6 +35,7 @@ verify_md5(){
fi
}
# ------------------------------------------------------------------------------
# This function collects the agent log, data and runs some tests, in case some
# error ocurred during the installation
collect_information(){
......@@ -65,6 +66,12 @@ collect_information(){
printf "Linux Educacional $(cat /etc/le_version)\n"
elif test "${DISTRO}" = "Ubuntu" -a -f "/usr/lib/edu/fbedu/tutorial.htm"; then
printf "Linux Educacional\n"
elif test "${DISTRO}" = "Mandriva"; then
head -n 1 /etc/issue
elif test "${DISTRO}" = "Welcome"; then
cut -sd "\\" -f1 /etc/issue | cut -d ' ' -f3-
else
cut -sd "\\" -f1 /etc/issue
fi
printf "Kernel\n"
cut -d " " -f3 /proc/version
......@@ -125,9 +132,10 @@ collect_information(){
printf "feito!\n\nFavor enviar o arquivo temporário \"${LOGFILE}\"%b%b%b" \
" para \"proinfodata@c3sl.ufpr.br\".\n\n" \
"Em caso de dúvidas, acesse o portal do PROINFODATA:\n" \
"seed.c3sl.ufpr.br\n" >&3
"proinfodata.c3sl.ufpr.br\n" >&3
}
# ------------------------------------------------------------------------------
printf "Iniciando instalação do agente PROINFODATA. Tenha certeza de %b%b%b" \
"estar conectado à Internet e executando este arquivo como super-" \
"usuário (root). Além disso, para o agente funcionar é necessário " \
......@@ -167,7 +175,7 @@ rm -rf "${AGENT_DIR}"
# Create seed_mec group and exit on error (except by the error of previous
# existence of seed_mec group)
if ! /usr/sbin/groupadd -f seed_mec; then
printf "ERRO: Falha ao criar o grupo seed_mec.\n"
printf "ERRO: Falha ao criar o grupo seed_mec.\n" >&3
exit 1
fi
......@@ -188,21 +196,22 @@ RETVAL=$?
# seed_mec user (return 9, which means the agent will be reinstalled), print an
# error message and exit
if test ${RETVAL} -ne 0 -a ${RETVAL} -ne 9; then
printf "ERRO: Falha ao criar o usuário seed_mec.\n"
printf "ERRO: Falha ao criar o usuário seed_mec.\n" >&3
exit 2
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
# error of wrong owner (lack of permissions)
crontab -u seed_mec -r
# Check if this is not an UCA Classmate, UCA Server nor ProInfo Projector, and
# Check if this is not an UCA Classmate, UCA Server nor PROINFO Projector, and
# if the line that gives root permission doesn't exist before adding it
if ! test -n "${PROJECTOR}" -o -f "/usr/sbin/projetor" -o \
-f "/etc/cmpc-release" -o -n "${UCA_SERVER}" -o \
......@@ -217,11 +226,12 @@ if ! test -n "${PROJECTOR}" -o -f "/usr/sbin/projetor" -o \
if ! $(echo -e "seed_mec\tALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers)
then
printf "ERRO: Falha ao adicionar permissões de super-usuário %b" \
"ao usuário seed_mec.\n"
"ao usuário seed_mec.\n" >&3
exit 3
fi
fi
# ------------------------------------------------------------------------------
# Uncompress tar package and check its integrity
tail -n +${BOOTSTRAP_LINES} $0 > "${SEED_MEC_HOME}/${FILE}"
cd "${SEED_MEC_HOME}"
......@@ -232,13 +242,14 @@ rm -rf "${AGENT_DIR}" &> /dev/null
tar xzf "${FILE}" &> /dev/null
rm -rf "${FILE}" &> /dev/null
# Change files owner
# Change files' owner
if ! chown -R seed_mec:seed_mec "${SEED_MEC_HOME}"; then
rm -rf "${SEED_MEC_HOME}" &> /dev/null
printf "ERRO: Falha ao mudar dono dos arquivos.\n"
printf "ERRO: Falha ao mudar dono dos arquivos.\n" >&3
exit 5
fi
# ------------------------------------------------------------------------------
# Export a variable to inform the agent that this is its first execution
export FIRST_EXECUTION=1
......@@ -247,9 +258,11 @@ if ! test -z ${LASTEXECBACKUP};then
echo ${LASTEXECBACKUP} > ${LASTEXEC}
fi
# Run the agent and check if its execution was alright, exiting in case of error
if ! su -c "bash ${AGENT_DIR}/agent.sh" seed_mec; then
printf "ERRO: Falha na execução do novo agente.\n"
# Run the agent and check if its execution went alright, exiting in case of
# error
if ! su -c "bash ${AGENT_DIR}/update.sh" seed_mec ||
! su -c "bash ${AGENT_DIR}/inventory.sh" seed_mec; then
printf "ERRO: Falha na execução do novo agente.\n" >&3
collect_information
exit 6
fi
......@@ -259,6 +272,6 @@ exec >&3 3>&-
printf "\nO agente PROINFODATA foi instalado com sucesso. %b%b" \
"Em caso de dúvidas, acesse o portal do PROINFODATA:\n" \
"seed.c3sl.ufpr.br\n"
"proinfodata.c3sl.ufpr.br\n"
exit 0
#!/bin/bash
# Copyright (C) 2004-2010 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 buildpackage
......@@ -21,21 +21,22 @@
# This is the update bootstrap
# That function verify the md5 of package is correct
# ------------------------------------------------------------------------------
# This function verifies if the package MD5 is correct
verify_md5(){
printf "[SEED2-update] Checking md5... "
printf "[SEED2-update] Checking MD5... "
if [[ ${MD5_CHECK} == $(md5sum "${SEED_MEC_HOME}/update/tmp/${FILE}" | \
awk '{print $1}') ]]; then
printf "OK!\n"
else
printf "ERROR: This package is currupted. Please, download it again.\n"
printf "ERROR: This package is currupted.\n"
rm -rf ${FILE} &> /dev/null
exit 1
fi
}
# Re-create the md5 from inep and proxy
# ------------------------------------------------------------------------------
# Re-create the inep and proxy's MD5
restore_inep_proxy_md5sum(){
for FILE in inep proxy; do
md5sum "${SEED_MEC_HOME}/SEED2/client/conf/${FILE}" |cut -d' ' -f1 > \
......@@ -47,7 +48,8 @@ restore_inep_proxy_md5sum(){
done
}
# Re-create the backup inep and proxy files and copy the md5 files
# ------------------------------------------------------------------------------
# Re-create the inep and proxy files' backup and copy the MD5 files
restore_inep_proxy_backup(){
for FILE in inep proxy; do
# The backup itself
......@@ -56,7 +58,8 @@ restore_inep_proxy_backup(){
done
}
# These variables will be replaced when generating package
# ------------------------------------------------------------------------------
# These variables will be replaced while generating the package
FILE=
MD5_CHECK=
BOOTSTRAP_LINES=
......@@ -68,8 +71,7 @@ else
fi
UPDATE_DIR="update/tmp/SEED2-run"
# Begin of script
# ------------------------------------------------------------------------------
# Create auxiliar directories
mkdir -p "${SEED_MEC_HOME}/update/tmp"
mkdir -p "${SEED_MEC_HOME}/update/old"
......@@ -81,10 +83,15 @@ cd "${SEED_MEC_HOME}/update/tmp"
tar xzf "${FILE}" &> /dev/null
cd - &> /dev/null
# Copy the configuration files and dependents to new tree
# ------------------------------------------------------------------------------
# Make sure the directories exist in the update tree to backup the inep and
# proxy files, along with their counterparts (backup and MD5)
mkdir -p "${SEED_MEC_HOME}/update/tmp/SEED2-run/client/conf"
mkdir -p "${SEED_MEC_HOME}/update/tmp/SEED2-run/.md5sum/client/conf"
mkdir -p "${SEED_MEC_HOME}/update/tmp/SEED2-run/.backup/client/conf"
mkdir -p "${SEED_MEC_HOME}/update/tmp/SEED2-run/.md5sum/.backup/client/conf"
# Check if inep and proxy files exist
# Check if the inep and proxy files exist
ERROR=0
INEP_PROXY="${SEED_MEC_HOME}/SEED2/client/conf/inep
${SEED_MEC_HOME}/SEED2/client/conf/proxy"
......@@ -92,10 +99,11 @@ for FILE in ${INEP_PROXY}; do
test -f "${FILE}" || ERROR=1
done
# Do nothing if there's no inep or proxy conf files
# Copy the inep and proxy files. Also, copy their backups and MD5 counterparts,
# if they exist. Otherwise, create them
if test "${ERROR}" -eq 0; then
# Copy inep and proxy to new tree
# Copy inep and proxy to the new tree
cp -a "${SEED_MEC_HOME}/SEED2/client/conf/"{inep,proxy} \
"${SEED_MEC_HOME}/update/tmp/SEED2-run/client/conf/"
......@@ -115,12 +123,12 @@ if test "${ERROR}" -eq 0; then
fi
# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# TODO: do some security backup???
#cp -ra "${SEED_MEC_HOME}/SEED2/" "${SEED_MEC_HOME}/old/"
# If something interrupt the script here, the tree will not be entirely
# correct, so we create a file to mark that something happened and on the
# If something interrupts the script here, the tree will not be entirely
# correct, so a file is created to mark that something happened. During the next
# next execution the package will try to recover itself
##### CRITICAL #####
touch "${SEED_MEC_HOME}/SEED2/updating"
......@@ -131,18 +139,19 @@ rm -rf "${SEED_MEC_HOME}/SEED2/.md5sum" \
mv -f "${SEED_MEC_HOME}/update/tmp/SEED2-run/"{.md5*,.back*}* \
"${SEED_MEC_HOME}/SEED2/"
# The files itself
rm -rf "${SEED_MEC_HOME}/SEED2/"{bin,lib,net,client,scripts,extra} &> /dev/null
# Copy the files themself
rm -rf "${SEED_MEC_HOME}/SEED2/"{bin,lib,net,client,extra,network-scripts,scripts} &> /dev/null
mv -f "${SEED_MEC_HOME}/update/tmp/SEED2-run/"* \
"${SEED_MEC_HOME}/SEED2/"
rm -f "${SEED_MEC_HOME}/SEED2/updating" &> /dev/null
### END CRITICAL ###
# ------------------------------------------------------------------------------
# Remove auxiliar directories
rm -rf "${SEED_MEC_HOME}/update" &> /dev/null
# Call the agent
"${SEED_MEC_HOME}/SEED2/agent.sh"
"${SEED_MEC_HOME}/SEED2/update.sh"
exit 0
#!/bin/bash
# Copyright (C) 2004-2010 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 buildpackage
......@@ -19,10 +19,21 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# This script compiles the agent files (collect and client) and prepares the
# directories tree necessary to build the installation and update packages. Exit
# status:
#
# 0 - Success
# 1 - Error while trying to load conf file
# 2 - Error: wget wasn't compiled
# 3 - Error: dynamically compiled wget
# 4 - Error while executing git pull
# 5 - Error while trying to compile the client
# 6 - Error while trying to compile the collect-parser
# ------------------------------------------------------------------------------
PREFIX="$(dirname $0)"
GITURL="http://git.c3sl.ufpr.br/pub/scm/proinfodata/"
GITBASEDIR="${PREFIX}/source"
GITBASEDIR="../"
WEBSERVICE="seed.c3sl.ufpr.br"
# Get the configuration
......@@ -36,22 +47,21 @@ fi
: ${AGENTDIR:="agent-files"}
: ${AGENTPACKAGEDIR:="SEED2-run"}
printf "====================\n$0 v0.1\n\n"
printf "**** Make sure that ${WEBSERVICE} webservice are up and running!!!\n"
printf "\nNOTE: This will take a while.\n"
printf " Make sure the git update process below will run ok.\n"
printf "====================\n\n"
# Check if wget have been build
# ------------------------------------------------------------------------------
# Check if wget was built
if ! test -f "${PREFIX}/wget-"*"/src/wget"; then
printf "ERROR (2): Please run build-wget before running this script. %b" \
"Aborting...\n"
exit 2
fi
# Sanity check, we do not want dynamic linked binaries on the package
# Check if wget is a static binary
ldd "${PREFIX}/wget-"*"/src/wget" &> /dev/null
if ! test $? -eq 1; then
printf "ERROR (3): The wget binary wasn't compiled with static library.%b" \
......@@ -62,43 +72,16 @@ fi
# Ensure $GITBASEDIR directory exists
mkdir -p "${GITBASEDIR}"
# Ensure all repositories are ok
printf "Updating git repositories...\n"
for repo in "${GITBASEDIR}/client:client" "${GITBASEDIR}/collect:collect"; do
REPOPATH="$(echo $repo |cut -d: -f1)"
REPONAME="$(echo $repo |cut -d: -f2)"
printf "${REPONAME}...\n"
# Check the environment
if ! cd "${REPOPATH}" 2> /dev/null; then
if ! cd "${GITBASEDIR}" 2> /dev/null; then
printf "ERROR (4): Something went wrong.\nMake sure that %b%b" \
"GITBASEDIR exists and the script has access to it. " \
"Aborting...\n"
exit 4
else
printf "git clone ${REPONAME}...\n"
if git clone ${GITURL}${REPONAME}.git
then
cd - &> /dev/null
cd "${REPOPATH}"
else
printf "ERROR (5): Something went wrong.\nProblems %b" \
"executing git clone(1). Aborting...\n"
exit 5
fi
fi
fi
if ! git pull; then
printf "ERROR (6): Something went wrong.\n Problems executing %b" \
"git pull(1). Aborting...\n"
exit 6
fi
cd - &> /dev/null
done
# Ensure the repository is updated
printf "Updating git repository...\n"
if ! git pull; then
printf "ERROR (4): Something went wrong.\n Problems executing %b" \
"git pull(1). Aborting...\n"
exit 4
fi
printf "\n\n"
# ------------------------------------------------------------------------------
# Compile the collect agent and the client
printf "Starting compilation process...\n\n"
printf "Starting client compilation...\n\n"
......@@ -106,13 +89,13 @@ sleep 1
cd "${GITBASEDIR}/client"
if make && make install; then
printf "\n\nClient compilation is finished.\n%b" \
printf "\n\nFinished client compilation.\n%b" \
"Everything was fine.\n\n"
else
printf "\n\n"
printf "ERROR (7): Client compilation is finished.\n%b" \
printf "ERROR (5): Finished client compilation.\n%b" \
"Something went wrong. Aborting...\n\n"
exit 7
exit 5
fi
cd -
......@@ -122,13 +105,13 @@ sleep 1
cd "${GITBASEDIR}/collect"
if make && make install; then
printf "\n\n"
printf "Collect-parser compilation is finished.\n%b" \
printf "Finished collect-parser compilation.\n%b" \
"Everything was fine.\n\n"
else
printf "\n\n"
printf "ERROR (8): Collect-parser compilation is finished.\n%b" \
printf "ERROR (6): Finished collect-parser compilation.\n%b" \
"Something went wrong. Aborting...\n\n"
exit 8
exit 6
fi
cd -
......
#!/bin/bash
# Copyright (C) 2004-2010 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 buildpackage
......@@ -19,7 +19,17 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# This function checks one file integrity
# This script builds the installation package. Exit status:
#
# 0 - Success
# 1 - Error: empty INEP
# 2 - Error: some files are corrupt
# 3 - Error while trying to copy the agent files
# 4 - Error while trying to copy the installation bootstrap
# 5 - Error while trying to compress the agent files
# ------------------------------------------------------------------------------
# This function checks the integrity of one file
check_file_integrity(){
FILE="$*"
FILEREAL="$(echo ${FILE} | sed "s#^${MD5DIRESC}##g")"
......@@ -53,6 +63,7 @@ if test -z "${INEP}"; then
printf "ERROR (1): Empty INEP.\n"
exit 1
fi
# -----------------------------------------------------------------------------
# Check all MD5 files
printf "Checking SEED2-run files integrity... "
......@@ -69,7 +80,7 @@ printf "done.\n"
# -----------------------------------------------------------------------------
# Start the tree creation process, removing any possible garbage before
# creating the INEP specific temporary directory
# creating the package specific temporary directory (using the INEP)
printf "Creating tree... "
rm -rf "/tmp/${INEP}"
......
#!/bin/bash
# Copyright (C) 2004-2010 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 buildpackage
......@@ -19,7 +19,17 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# This function checks one file integrity
# This script builds the update package. Exit status:
#
# 0 - Success
# 1 - Error while trying to load conf file
# 2 - Error: version file is not readable
# 3 - Error: some files are corrupt
# 4 - Error while trying to compress the agent files
# 5 - Error: MD5 directory is missing
# ------------------------------------------------------------------------------
# This function checks the integrity of one file
check_file_integrity(){
FILE="$*"
FILEREAL="$(echo ${FILE} | sed "s#^${MD5DIRESC}##g")"
......@@ -29,10 +39,11 @@ check_file_integrity(){
diff - "${FILE}" &> /dev/null) || return 1
}
# ------------------------------------------------------------------------------
PREFIX="$(dirname $0)"
BOOTSTRAP="${PREFIX}/bootstraps/bootstrap-update"
# Get the configuration
# Get configuration
if ! source "${PREFIX}/buildpackage.conf" 2> /dev/null; then
printf "ERROR (1): Failed to load buildpackage.conf.\n"
exit 1
......@@ -48,6 +59,7 @@ MD5DIR="${AGENTPACKAGEDIR}/.md5sum"
MD5DIRESC="$(echo ${MD5DIR} | sed "s/\./\\\./g")"
VERSIONFILE="${AGENTDIR}/${AGENTPACKAGEDIR}/client/conf/version"
# ------------------------------------------------------------------------------
printf "====================\n"
printf "$0 v0.1\n\n"
printf "*** Make sure ${AGENTDIR}/${AGENTPACKAGEDIR}\n"
......@@ -67,7 +79,7 @@ OUTPUT="${UPDATEDIR}/SEED2-update-${VERSION}.run"
# Change to agent directory
cd "${AGENTDIR}"
# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Check all MD5 files
printf "Checking SEED2-run files integrity... "
......@@ -87,7 +99,7 @@ done
printf "done.\n"
# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Compress the agent files
printf "Compressing SEED2-run files... "
......@@ -101,7 +113,7 @@ cd - &> /dev/null
printf "done.\n"
# End of agent compression
# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Calculate the MD5
printf "Calculating MD5... "
......@@ -110,7 +122,7 @@ MD5_CHECK=$(md5sum ${TARFILE} | awk '{print $1}')
printf "done.\n"
# End of MD5 calculation
# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Generate the update package
printf "Creating update .run package... "
......
#!/bin/bash
# Copyright (C) 2004-2010 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 buildpackage
......@@ -19,9 +19,24 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# This script downloads and compiles the wget binary. Exit status:
#
# 0 - Success
# 1 - Error while trying to download wget
# 2 - Error while trying to unpack wget package
# 3 - Error while trying to configure wget
# 4 - Error while trying to compile wget
# ------------------------------------------------------------------------------
PREFIX="$(dirname $0)"
# Check if wget is already compiled
if test -x wget-*/src/wget; then
printf "Wget already compiled. %b" \
"Remove its folder if you want to recompile it.\n"
exit 0
fi
printf "====================\n$0 v0.1\n\n"
printf "**** Make sure that you are connected to the internet!!!\n"
printf "====================\n\n"
......@@ -32,22 +47,23 @@ rm -Rf wget-*
# Download the latest wget package
wget http://gnu.c3sl.ufpr.br/ftp/wget/wget-1.13.4.tar.gz -O wget.tar.gz || \
(printf "ERROR (1): Failed to download the latest wget version. %b" \
"Aborting...\n" && exit 2)
"Aborting...\n" && exit 1)
# Unpack
tar xvzf wget.tar.gz &> /dev/null || \
(printf "ERROR (2): Failed to unpack wget. Aborting...\n" && exit 3)
(printf "ERROR (2): Failed to unpack wget. Aborting...\n" && exit 2)
# Configure and compile
cd wget-*
CFLAGS=-m32 ./configure --without-ssl --disable-opie --disable-digest \
--disable-ntlm --disable-debug --disable-nls --disable-largefile \
--disable-ipv6 --disable-rpath --disable-iri || \
(printf "ERROR (3): Failed to configure wget. Aborting...\n" && exit 4)
(printf "ERROR (3): Failed to configure wget. Aborting...\n" && exit 3)
make LDFLAGS=-static ||
(printf "ERROR (4): Failed to compile wget. Aborting...\n" && exit 5)
(printf "ERROR (4): Failed to compile wget. Aborting...\n" && exit 4)
cd - &> /dev/null
printf "\nAll done.\n\n"
exit 0
#!/bin/bash
# Copyright (C) 2004-2010 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 buildpackage
......@@ -19,7 +19,14 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# This script creates MD5 files and the necessary backup from the agent files to
# allow the agent to check its files' integrity. Exit status:
#
# 0 - Success
# 1 - Error while trying to load conf file
# 2 - Error while trying to change to the agent's directory
# ------------------------------------------------------------------------------
PREFIX="$(dirname $0)"
# Get the configuration
......@@ -39,13 +46,14 @@ BACKUPDIR=".backup"
# The list of files to backup. client/conf/{inep,proxy} will be added in the
# creation process
BACKUPLIST="agent.sh collect.conf client/run.sh client/bin/client
load-config.sh client/common.sh client/conf/version collect.conf"
BACKUPLIST="agent.conf extra-tincuca.sh inventory.sh load-config.sh
network-usage.sh update.sh integrity-checker.sh bin/collect-parser bin/wget
client/run.sh client/common.sh client/bin/client client/conf/version"
printf "====================\n$0 v0.1\n\nNOTE: Make sure this is the last %b" \
"thing you do before publishing the package.\n====================\n\n"
# ------------------------------------------------------------------------------
if ! cd "${BASEDIR}"; then
printf "ERROR (2): Something went wrong: can't access the agent files. %b" \
"Aborting...\n"
......@@ -57,6 +65,7 @@ mkdir -p "${MD5DIR}"
printf "Starting backup files creation... "
mkdir -p "${BACKUPDIR}/client/"{conf,bin}
mkdir -p "${BACKUPDIR}/bin"
for FILE in ${BACKUPLIST}; do
cp -a "${FILE}" "${BACKUPDIR}/${FILE}"
done
......@@ -72,5 +81,5 @@ for FILE in $(find . -type f); do
done
printf "done.\n"
printf "\nAll done.\n"
exit 0
#!/bin/bash
# Copyright (C) 2004-2010 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 buildpackage
......
/* Copyright (C) 2004-2010 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 getSchoolInfo
......
/* Copyright (C) 2004-2010 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 getSchoolInfo
......
#!/bin/bash
# Copyright (C) 2004-2010 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 proinfodata
......
#!/bin/bash -e
# Copyright (C) 2004-2010 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 proinfodata
......
#!/bin/bash
# Copyright (C) 2004-2010 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 proinfodata
......
#!/bin/bash
# Copyright (C) 2004-2010 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 proinfodata
......
#!/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 client, it is used to store common functions
......
#!/bin/bash
# Create run.sh file
# 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 client
......@@ -25,7 +25,7 @@ cat