The aim of this Project is to create a deamon for a server, wich update live systems.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
653 B

#!/bin/bash
#remaster lib
[ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; }
#chroot_umount [chroot_dir]
function chroot_umount() {
echo -n "unmount chroot ... "
#check chroot dir
chroot_dir="$1"
[ -d "$chroot_dir" ] || {
echo "### ERROR ### chroot_umount: chroot directory not exist!"
return 12
}
for d in "$chroot_dir/tmp" "$chroot_dir/root" "$chroot_dir/proc" "$chroot_dir/dev" ; do
umount $d
retval=$?
[ "$retval" -gt 0 ] && {
echo "### ERROR ### chroot_umount: can't umount \"$d\"!"
return 21
}
done
echo "done"
}
#this func is standalone executable
[ -n "$1" ] && {
chroot_umount $@
}