Merging casper 1.111.
[live-boot-grml.git] / scripts / live-functions
1 #!/bin/sh
2
3 . /scripts/functions
4 . /live.vars
5
6 log_wait_msg ()
7 {
8         # Print a message and wait for enter
9         if [ -x /sbin/usplash_write ]
10         then
11                 /sbin/usplash_write "INPUTENTER ${@}"
12                 read nunya < /dev/.initramfs/usplash_outfifo
13         fi
14
15         _log_msg "Waiting: ${@} ..."
16 }
17
18 really_export ()
19 {
20         STRING="${1}"
21         VALUE="$(eval echo -n \${$STRING})"
22
23         if [ -f /live.vars ] && cat /live.vars | grep -sq "export ${STRING}"
24         then
25                 sed -i -e 's/\('${STRING}'=\).*$/\1'${VALUE}'/' /live.vars
26         else
27                 echo "export ${STRING}=\"${VALUE}\"" >> /live.vars
28         fi
29
30         eval export "${STRING}"="${VALUE}"
31 }