# textdatei #!/usr/bin/ksh test -n "$1" || exit DIR="$1" test -d "$DIR" || DIR="/hd/$1" test -d "$DIR" || exit cd "$DIR" || exit #set -x for D in dev dev/pts dev/shm sys proc temp daten run do if mount|grep "/${DIR##*/}/$D" >/dev/null then true # echo $D ok else test -d "/$D" || continue test -d "$D" || mkdir -p "$D" mount --bind /$D $D fi done ls -l /hd|cut -c 43-|grep -- "->"|grep -E "temp|daten|gentoo"|grep -vE "novell|test|temp1"|while read DIR D1 MOUNT do if [ -e "$MOUNT" ] then if mount|grep "/${DIR##*/}$MOUNT" >/dev/null then true else test -d ${MOUNT#/} || mkdir -p ${MOUNT#/} mount --bind $MOUNT ${MOUNT#/} fi fi done chroot . #echo "/${DIR##*/}" if [ $(ls -l /proc/[0-9]*/exe 2>/dev/null|grep "/${DIR##*/}"|wc -l) -gt 0 ] then echo "Es wurden noch nicht alle Programm geschlossen" exit fi mount |grep "/${DIR##*/}"|cut -d" " -f3|sort -r|while read DIR1 do if [ "/${DIR##*/}" != "/${DIR1##*/}" ] then umount $DIR1 # echo $DIR1 fi done