From f7ed0e72f222374051593c84901826719eaa7c9c Mon Sep 17 00:00:00 2001 From: Ian Leonard Date: Mon, 11 May 2020 16:17:43 +0000 Subject: [PATCH] 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 --- config/show_config | 8 ++++++++ 1 file changed, 8 insertions(+) mode change 100644 => 100755 config/show_config diff --git a/config/show_config b/config/show_config old mode 100644 new mode 100755 index f97a2bb6ac..48d17afa7a --- a/config/show_config +++ b/config/show_config @@ -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