Skip to content
Snippets Groups Projects
Commit 9a4f1139 authored by Recolic's avatar Recolic :house_with_garden:
Browse files

.

parent 4e591634
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ lc_init () {
echo 'rtest ALL=(ALL) NOPASSWD: ALL' | EDITOR='tee -a' visudo
usermod --password $(echo testpass | openssl passwd -1 -stdin) rtest
sudo -u rtest realpath masterconf.sh || ! echo "ERROR: rtest do not have access to config dir." || exit 1
sudo -u rtest linuxconf register masterconf.sh
# more customization...
......
......@@ -25,14 +25,14 @@ function lc_include () {
# print the return code of the eval-ed function to stderr, but this function should always return success.
for script in "$@"; do
[[ -f "$script" ]] || err "ERROR: DEBUG: script not exist >>$script<<" || continue
echo2 "$script -- $LCI_SUBSHELL_OP started as $(whoami), at $(pwd)"
(
source "$script"
declare -F "$LCI_SUBSHELL_OP" >/dev/null 2>&1 || exit 0
declare -F "$LCI_SUBSHELL_OP" >/dev/null 2>&1 || exit 0
eval "$LCI_SUBSHELL_OP"
)
echo2 "$script -- $LCI_SUBSHELL_OP completed with status $return_code"
echo2 "$script -- $LCI_SUBSHELL_OP completed with status $?"
# TODO: should I abort on failure? But for nested lc_include, I cannot know if it failed.
done
return 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment