File:  [Paefchen] / home / as / scripts / jshell.sh
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Jan 7 06:03:06 2008 UTC (16 years, 10 months ago) by as
Branches: MAIN
CVS tags: HEAD
Hello My Home ;)

#!/bin/sh
# $Paefchen: home/as/scripts/jshell.sh,v 1.1 2008/01/07 06:03:06 as Exp $

if [ $# -ne 1 ]
then
	echo "usage $0: <jail-name>"
	exit 1
fi


if [ -r /etc/defaults/rc.conf ]
then
	. /etc/defaults/rc.conf
	source_rc_confs
elif [ -r /etc/rc.conf ]
then
	. /etc/rc.conf
fi

eval jip=\"\$jail_${1}_ip\"

if [ -z "$jip" ]
then
	echo "error: jail $1 not found"
	exit 1
fi

jid=$(jls | awk -v ip=$jip '$2 == ip {print $1}')

if [ -z "$jid" ]
then
	echo "error: jail not running?"
	exit 1
fi

jexec $jid $SHELL