X-Git-Url: http://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fboot%2Fmisc-helpers.sh;h=abb2dd218ebc22134f18595de6d8e7b76a465fc8;hb=dc6d1a0b26dae2b2197631bb4f94738a289e7b8a;hp=fe45ee11c2e380056a9288b68389ec2e78c9fab9;hpb=23c2e9f4947a2d9be6b63f55cca8e633df3455a3;p=live-boot-grml.git diff --git a/scripts/boot/misc-helpers.sh b/scripts/boot/misc-helpers.sh index fe45ee1..abb2dd2 100755 --- a/scripts/boot/misc-helpers.sh +++ b/scripts/boot/misc-helpers.sh @@ -2,6 +2,21 @@ #set -e +really_export () +{ + STRING="${1}" + VALUE="$(eval echo -n \${$STRING})" + + if [ -f /live.vars ] && grep -sq "export ${STRING}" /live.vars + then + sed -i -e 's/\('${STRING}'=\).*$/\1'${VALUE}'/' /live.vars + else + echo "export ${STRING}=\"${VALUE}\"" >> /live.vars + fi + + eval export "${STRING}"="${VALUE}" +} + is_in_list_separator_helper () { local sep=${1} shift