I need to write a script to where the lower half does not execute until the current shell runs an exit or logout command. How can I do this? The script I need this on is below.

mount -v --bind /dev $LFS/dev        &&
mount -vt devpts devpts $LFS/dev/pts &&
mount -vt proc proc $LFS/proc        &&
mount -vt sysfs sysfs $LFS/sys       &&
chroot "$LFS" /tools/bin/env -i \
    HOME=/root                  \
    TERM="$TERM"                \
    PS1='\u:\w\$ '              \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h

#logout
#umount -v $LFS/dev/pts
#umount -v $LFS/dev/shm
#umount -v $LFS/dev
#umount -v $LFS/proc
#umount -v $LFS/sys

get info on .bash_logout itll run when the user logs out

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.