adding config support for password via shared file

This commit is contained in:
anthraxx 2015-02-06 23:34:57 +01:00
commit 12be452e56
5 changed files with 19 additions and 2 deletions

13
shared Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
config="dooris.conf"
# warn if local config file is missing
if [ ! -f "${config}" ]; then
echo "WARNING: ${config} is missing!" >&2
fi
# get password config value in a safe way
password="$(grep password ${config} 2>/dev/null|cut -d= -f2|tr -d ' \t')"
if [ -z "${password}" ]; then
echo "WARNING: password in ${config} is missing!" >&2
fi