diff options
author | Aaron LI <aly@aaronly.me> | 2018-03-10 19:26:15 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-03-10 19:26:15 +0800 |
commit | 48483381ffa0338a6f0dbf476e884afecf60171c (patch) | |
tree | 00fec850571052355ddc6b977bf9a9a46c11cd05 | |
parent | 7d8c1423d7b6db8881c3b8ab075a3395b9410aba (diff) | |
download | dfly-update-48483381ffa0338a6f0dbf476e884afecf60171c.tar.bz2 |
Remove load_config() and simply source the config file
-rwxr-xr-x | dfly-update | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/dfly-update b/dfly-update index 46534f4..b1ee98f 100755 --- a/dfly-update +++ b/dfly-update @@ -53,19 +53,6 @@ check_os() { fi } -# Load configurations from file -load_config() { - local configfile="$1" - local tmpcfg=$(mktemp -t ${NAME}) || exit ${EC_TMPFILE} - if [ ! -r "${configfile}" ]; then - error "Cannot read configuration file: ${configfile}" - exit ${EC_CONFIGFILE} - fi - # Filter out only valid configurations to be secure - egrep '^[^ ]*=[^;&]*' ${configfile} > ${tmpcfg} - . ${tmpcfg} - rm -f ${tmpcfg} -} # Get the branch of the installed system # * DEVELOPMENT @@ -220,7 +207,7 @@ cmd_extension_or_status() { # # Load configurations -[ -r "${CONFIGFILE}" ] && load_config ${CONFIGFILE} +[ -r "${CONFIGFILE}" ] && . ${CONFIGFILE} COMMAND="$1" case "${COMMAND}" in |