Fixes configuration loading

Two bugs were introduced when adding configuration file support:
* Passing the message as script parameter was not working when `-c` option was
  used (eg. `script -c cfg msg`)
* `-c` configuration file was not loaded properly

This commit fixes these 2 bugs.
This commit is contained in:
C-Duv 2017-02-11 16:40:39 +01:00
parent 3e12046b97
commit afccc39b37

View File

@ -39,6 +39,7 @@ while getopts "c:h" option; do
h) usage_help ; exit 0 ;;
esac
done
shift $((OPTIND-1))
##
@ -84,7 +85,7 @@ Le serveur de la maison"
if [ -n "${CONFIG_FILE}" ]; then
if [ -e "${CONFIG_FILE}" ]; then
. "./${CONFIG_FILE}"
. "${CONFIG_FILE}"
else
echo "ERROR: Configuration file \"${CONFIG_FILE}\" does not exists." >&2
exit 2
@ -97,6 +98,7 @@ else
fi
fi
##
## Vérifications des paramètres requis
##