User Tools

Site Tools


script:minichroot.sh
#!/bin/sh
#
# This script was written by David Courtney of Ultradesic
# http://www.ultradesic.com
# E-Mail Contact: minibsd@ultradesic.com
# 
# /root/minichroot.sh
#
# Sajó Zsolt Attila modified at May 02, 2008.
# Use ./minichroot.sh ${YOUR/JAIL/PATH} command
#
JAILDIR=$1
touch /root_check ;
cp -f /etc/resolv.conf ${JAILDIR}/etc/resolv.conf ;
if [ ! -f ${JAILDIR}/boot/kernel/kernel ] ; then
	cp /boot/kernel/kernel ${JAILDIR}/boot/kernel/kernel ;
fi ;
if [ ! -f ${JAILDIR}/etc/localtime ] ; then
	cp /etc/localtime ${JAILDIR}/etc/localtime ;
fi ;
if ( [ ! -f ${JAILDIR}/etc/wall_cmos_clock ] && [ -f /etc/wall_cmos_clock ] ) ; then
	cp /etc/wall_cmos_clock ${JAILDIR}/etc/wall_cmos_clock ;
fi ;

if [ ! -c ${JAILDIR}/dev/null ] ; then
    mount -t devfs devfs ${JAILDIR}/dev ;
    if [ ! -c ${JAILDIR}/dev/null ] ; then
	echo ;
	echo "Unable to mount dev file system!" ;
	echo ;
	echo "Exiting..." ;
	echo ;
	exit ;
    fi ;
fi ;
chroot ${JAILDIR} /bin/csh ;
rm /root_check ;
exit ;
# End of /root/minichroot.sh
script/minichroot.sh.txt · Utolsó módosítás: 2008/10/07 22:50 szerkesztette: arkhein