From ff5d90c312ef473db5870765e5da5dbc973162f3 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 13 Jul 2019 20:53:04 +0200 Subject: [PATCH 1/4] catch --config param --- src/remaster.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/remaster.sh b/src/remaster.sh index 5eb1af7..cbd28e9 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -54,6 +54,9 @@ fi echo Remaster 2.0.4 exit 0 ;; + config|c) + echo "[WIP]" + ;; *) echo 'Remaster update Live Systems' echo ' more information at: https://github.com/6543/remaster/' From 189fd6d56c23612e0a4f8a6297eb180a64cd81a9 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 13 Jul 2019 20:57:25 +0200 Subject: [PATCH 2/4] read custom config file --- src/remaster.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/remaster.sh b/src/remaster.sh index cbd28e9..3d3a746 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -55,7 +55,12 @@ fi exit 0 ;; config|c) - echo "[WIP]" + if [ -f "$2" ]; then + source "$2" + else + echo "ERROR Config \"$2\" not found" + fi + else ;; *) echo 'Remaster update Live Systems' From 90926de1d637b3bdba92a0f314592c6092528be2 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 13 Jul 2019 21:03:30 +0200 Subject: [PATCH 3/4] add clear_config func() --- src/func/clear_config | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 src/func/clear_config diff --git a/src/func/clear_config b/src/func/clear_config new file mode 100755 index 0000000..e059ff4 --- /dev/null +++ b/src/func/clear_config @@ -0,0 +1,35 @@ +#!/bin/bash +#remaster lib +[ -d "" ] || { echo "LIBDIR not exist"; exit 1; } + +#check_config +function clear_config() { + + ## Source & Aim options + iso_source= + squashfs_path= + iso_aim= + iso_lable= + + ## network + proxy_host= + proxy_port= + domain= + nameserver= + + ## Project / Distro + project= + + ## LOG Settings + log_file= + log_mail_source= + log_mail_smtp= + log_mail_aim= + log_mail_subject= + +} + +#this func is standalone executable +[ -n "$1" ] && { + clear_config $@ +} From 2ac2fd9cd22c0a4378222ae2f7dbc85a56e56746 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 13 Jul 2019 21:04:19 +0200 Subject: [PATCH 4/4] finisch custom config option --- src/remaster.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/remaster.sh b/src/remaster.sh index 3d3a746..fd2a92c 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -56,9 +56,11 @@ fi ;; config|c) if [ -f "$2" ]; then + source /func/clear_config source "$2" else echo "ERROR Config \"$2\" not found" + exit 1 fi else ;;