diff options
Diffstat (limited to 'sh/rc-functions.sh')
-rw-r--r-- | sh/rc-functions.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sh/rc-functions.sh b/sh/rc-functions.sh index 81d065b8..922bb870 100644 --- a/sh/rc-functions.sh +++ b/sh/rc-functions.sh @@ -134,6 +134,23 @@ _depend() { done } +save_variables() { + mkdir -p "${RC_SVCDIR}"/env/ + + local _envname + + if [ -n "${export_vars}" ]; then + rm "${RC_SVCDIR}/env/${RC_SVCNAME}" + for _envname in ${export_vars}; do + eval echo "${_envname}=\$${_envname}" >> "${RC_SVCDIR}/env/${RC_SVCNAME}" + done + fi +} + +load_variables() { + sourcex -e "${RC_SVCDIR}/env/*" +} + # Add our sbin to $PATH case "$PATH" in "$RC_LIBEXECDIR"/sbin|"$RC_LIBEXECDIR"/sbin:*);; |