Initial checkin
[live-initramfs-grml.git] / scripts / live-functions
1 #!/bin/sh
2
3 . /scripts/functions
4 . /live.vars
5
6 log_end_msg ()
7 {
8         # Override this so we don't call PROGRESS
9         if [ -x /sbin/usplash_write ]
10         then
11                 /sbin/usplash_write "SUCCESS ok"
12         fi
13
14         _log_msg "Done."
15 }
16
17 log_wait_msg ()
18 {
19         # Print a message and wait for enter
20         if [ -x /sbin/usplash_write ]
21         then
22                 /sbin/usplash_write "INPUTENTER ${@}"
23                 read nunya < /dev/.initramfs/usplash_outfifo
24         fi
25
26         _log_msg "Waiting: ${@} ..."
27 }
28
29 really_export ()
30 {
31         STRING="${1}"
32         VALUE="$(eval echo -n \${$STRING})"
33
34         if [ -f /live.vars ] && cat /live.vars | grep -sq "export ${STRING}"
35         then
36                 sed -i -e 's/\('${STRING}'=\).*$/\1'${VALUE}'/' /live.vars
37         else
38                 echo "export ${STRING}=\"${VALUE}\"" >> /live.vars
39         fi
40
41         eval export "${STRING}"="${VALUE}"
42 }