-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlive
More file actions
executable file
·54 lines (49 loc) · 1.01 KB
/
Copy pathlive
File metadata and controls
executable file
·54 lines (49 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
test_aufs()
{
if [ ! -d /fll/aufs ]; then
echo "No /fll/aufs directory exists ! Will exit now."
exit 1
fi
}
MountLive()
{
if ! ischroot ; then
# mounts dev proc sys dev/pts under /fll/aufs
echo " Mounting dev proc sys dev/pts under /fll/aufs and chroot there."
echo " Please run exit and then live out to exit chroot."
for i in dev dev/pts proc sys ; do
mount --bind /$i /fll/aufs/$i
done
chroot /fll/aufs
else
echo "Please exit chroot and type live go"
fi
}
UmountLive()
{
# umounts dev proc sys dev/pts from /fll/aufs
if ! ischroot ; then
echo " Umounting dev proc sys dev/pts from fll/aufs."
for i in sys proc dev/pts dev ; do
umount /fll/aufs/$i
done
else
echo "Please exit chroot and type live out"
fi
}
case "$1" in
go)
test_aufs
MountLive
;;
out)
test_aufs
UmountLive
;;
*)
echo "This script should be runned outside chroot"
echo "Usage: live {go|out}"
exit 1
;;
esac