projects
/
petitboot
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
636c5ad36dff65d449d310309989d8c6967e6e65
[petitboot]
/
utils
/
pb-console
1
#!/bin/sh
2
3
ui=petitboot-nc
4
shell=sh
5
6
detach=0
7
8
while [ -n "$1" ]
9
do
10
case "$1" in
11
-d)
12
detach=1
13
;;
14
--)
15
;;
16
*)
17
console=$1
18
;;
19
esac
20
shift
21
done
22
23
if [ -n "$console" -a "${console#/dev/}" = "$console" ]
24
then
25
console="/dev/$console"
26
fi
27
28
pb_loop() {
29
while :
30
do
31
$ui
32
echo "Exiting petitboot. Type 'exit' to return"
33
$shell
34
done
35
}
36
37
if [ -n "$console" ]
38
then
39
exec <$console >$console 2>&1
40
fi
41
42
if [ "$detach" = 1 ]
43
then
44
(
45
pb_loop
46
) &
47
else
48
pb_loop
49
fi