lsgm/live/source/env.sh

54 lines
875 B
Bash
Raw Normal View History

2023-09-30 12:46:03 +00:00
function env {
action="${1}"
setparams \
2023-11-21 08:13:18 +00:00
'check_squashfs' 'time_out'
2023-09-30 12:46:03 +00:00
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-11-11 15:36:57 +00:00
grub_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 {
2023-11-21 08:13:18 +00:00
check_squashfs='enforce'
2023-09-30 12:46:03 +00:00
time_out=10
}