39 |
fi |
fi |
40 |
: > ${CONFIG} |
: > ${CONFIG} |
41 |
} |
} |
42 |
|
|
43 |
|
is_loc_mounted() |
44 |
|
{ |
45 |
|
local mountpoint |
46 |
|
local i |
47 |
|
mountpoint=$1 |
48 |
|
|
49 |
|
i="$(cat /proc/mounts | grep " ${mountpoint} " | cut -d ' ' -f2)" |
50 |
|
[[ ${i} != ${mountpoint} ]] && return 1 |
51 |
|
|
52 |
|
return 0 |
53 |
|
} |
54 |
|
|
55 |
|
trap_exit() |
56 |
|
{ |
57 |
|
[[ -n ${SWAPHDD} ]] && swapoff ${SWAPHDD} |
58 |
|
is_loc_mounted "${INSTALLPATH}/dev" && umount ${INSTALLPATH}/dev |
59 |
|
is_loc_mounted "${INSTALLPATH}/proc" && umount ${INSTALLPATH}/proc |
60 |
|
is_loc_mounted "${INSTALLPATH}/sys" && umount ${INSTALLPATH}/sys |
61 |
|
is_loc_mounted "${INSTALLPATH}/boot" && umount ${INSTALLPATH}/boot |
62 |
|
is_loc_mounted "${INSTALLPATH}" && umount ${INSTALLPATH} |
63 |
|
echo "installation aborted" |
64 |
|
exit 1 |
65 |
|
} |