config/show_config: allow direct execution

FUNCNAME[0] is a bash builtin that corresponds to the name of the currently executing
function. Functions called in bare scripts are in the main() function. Bare scripts
being sourced are in the source() function.

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
This commit is contained in:
Ian Leonard 2020-05-11 16:17:43 +00:00
parent 0ea91f8079
commit f7ed0e72f2

8
config/show_config Normal file → Executable file
View File

@ -1,3 +1,5 @@
#!/bin/bash
show_config() {
# load graphic configuration
get_graphicdrivers
@ -115,3 +117,9 @@ show_config() {
echo -e "$config_message"
}
if [ "${FUNCNAME[0]}" = "main" ]; then
. config/options ""
show_config
fi