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