autoport-chroot: set a shell prompt containing chroot name

This commit is contained in:
Silvan Calarco 2013-04-22 12:28:47 +02:00
parent 06d4c75c90
commit ac6f81462a

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# autoport-chroot
# (c) 2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
# (c) 2012-2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
. /etc/sysconfig/autoport
@ -36,6 +36,9 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
CMD_PREFIX=
fi
echo "Entering ${AUTOPORT_CHROOT[$i]} autoport chroot environment"
[ -e /var/autoport/${AUTOPORT_CHROOT[$i]}/etc/profile.d/autoport.sh ] || {
echo "PS1='[\u@${AUTOPORT_CHROOT[$i]} \W]\$ '" > /var/autoport/${AUTOPORT_CHROOT[$i]}/etc/profile.d/autoport.sh
}
$CMD_PREFIX /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} su -l ${AUTOPORT_CHROOT_USER[$i]}
exit 0
done