lsgm/live/source/env.sh

53 lines
828 B
Bash
Raw Normal View History

2023-09-30 12:46:03 +00:00
function env {
action="${1}"
setparams \
'time_out'
if [ "${action}" == 'load' ] ; then
load_env \
--skip-sig \
--file "${env}" "${@}"
fi
if [ "${action}" == 'save' ] ; then
save_env \
--file "${env}" "${@}"
fi
}
function env_apply {
if [ "${default}" ] ; then
timeout=${time_out}
else
unset timeout
fi
}
function env_init {
2023-10-01 17:59:50 +00:00
set_init
2023-09-30 12:46:03 +00:00
env_set
env_mod
env_apply
}
function env_list {
list_env \
--skip-sig \
--file "${env}"
}
function env_mod {
2023-10-01 17:59:50 +00:00
env_mod='---'
2023-09-30 12:46:03 +00:00
if [ -f "${env}" ] ; then
2023-10-01 17:59:50 +00:00
env_mod='--x'
2023-09-30 12:46:03 +00:00
if env 'load' ; then
2023-10-01 17:59:50 +00:00
env_mod='r-x'
2023-09-30 12:46:03 +00:00
if env 'save' ; then
2023-10-01 17:59:50 +00:00
env_mod='rwx'
2023-09-30 12:46:03 +00:00
fi
fi
fi
}
function env_set {
time_out=10
}