* [PATCH] config: improve config_get_id_from_config and config_get_hook_from_config
@ 2017-07-19 8:23 Jonatan Schlag
0 siblings, 0 replies; only message in thread
From: Jonatan Schlag @ 2017-07-19 8:23 UTC (permalink / raw)
To: network
[-- Attachment #1: Type: text/plain, Size: 722 bytes --]
Signed-off-by: Jonatan Schlag <jonatan.schlag(a)ipfire.org>
---
src/functions/functions.config | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/functions/functions.config b/src/functions/functions.config
index e11a1c2..6a148c7 100644
--- a/src/functions/functions.config
+++ b/src/functions/functions.config
@@ -58,8 +58,7 @@ config_get_id_from_config() {
assert [ $# -eq 1 ]
local config=${1}
- local hook=$(config_get_hook_from_config ${config})
- echo "${config//"${hook}."/}"
+ echo "${config##*.}"
}
@@ -69,5 +68,5 @@ config_get_hook_from_config() {
assert [ $# -eq 1 ]
local config=${1}
- echo "${config//.*[[:digit:]]/}"
+ echo "${config%%.*[[:digit:]]}"
}
--
2.6.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-19 8:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-19 8:23 [PATCH] config: improve config_get_id_from_config and config_get_hook_from_config Jonatan Schlag
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox