Skip to content
Snippets Groups Projects
Commit ac7d1662 authored by Erik Alexandre Pucci's avatar Erik Alexandre Pucci Committed by Danilo K. S. Yorinori
Browse files

run-config.sh: Added "log" variable containing the "run.log" file

parent a921027e
No related branches found
No related tags found
No related merge requests found
......@@ -48,12 +48,13 @@ cat > run.sh << 'EOF'
dirname=$(dirname $0)
basename=$(basename ${dirname})
bindir=${dirname}/bin
log=${dirname}/run.log
# Redirects all error output to log file
exec 2>> ${dirname}/run.log
exec 2>> ${log}
# Timestamp
date +"%F %T" >> ${dirname}/run.log
date +"%F %T" >> ${log}
# Get common functions
source ${dirname}/common.sh
......@@ -74,21 +75,19 @@ fi
# Execution
if test $# -ne 1; then
echo "Run.sh call: wrong number of parameters ($#)." \
>> ${dirname}/run.log
echo "Run.sh call: wrong number of parameters ($#)." >> ${log}
exit 101
elif [[ $1 == "--inventory" ]]; then
${bindir}/client $1 ${url} ${inep} ${proxy} ${interface} \
>> ${dirname}/run.log
${bindir}/client $1 ${url} ${inep} ${proxy} ${interface} >> ${log}
elif [[ $1 == "--update" ]]; then
retstr=$(${bindir}/client $1 ${url} ${proxy} ${interface})
retval=$?
if test ${retval} -eq 4; then
echo "$retstr" | tee -a ${dirname}/run.log
echo "$retstr" | tee -a ${log}
fi
exit $retval
else
echo "Run.sh call: wrong parameter (\"$1\")." >> ${dirname}/run.log
echo "Run.sh call: wrong parameter (\"$1\")." >> ${log}
exit 102
fi
EOF
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment