Annotation of home/as/scripts/jshell.sh, revision 1.1

1.1     ! as          1: #!/bin/sh
        !             2: # $Paefchen$
        !             3: 
        !             4: if [ $# -ne 1 ]
        !             5: then
        !             6:        echo "usage $0: <jail-name>"
        !             7:        exit 1
        !             8: fi
        !             9: 
        !            10: 
        !            11: if [ -r /etc/defaults/rc.conf ]
        !            12: then
        !            13:        . /etc/defaults/rc.conf
        !            14:        source_rc_confs
        !            15: elif [ -r /etc/rc.conf ]
        !            16: then
        !            17:        . /etc/rc.conf
        !            18: fi
        !            19: 
        !            20: eval jip=\"\$jail_${1}_ip\"
        !            21: 
        !            22: if [ -z "$jip" ]
        !            23: then
        !            24:        echo "error: jail $1 not found"
        !            25:        exit 1
        !            26: fi
        !            27: 
        !            28: jid=$(jls | awk -v ip=$jip '$2 == ip {print $1}')
        !            29: 
        !            30: if [ -z "$jid" ]
        !            31: then
        !            32:        echo "error: jail not running?"
        !            33:        exit 1
        !            34: fi
        !            35: 
        !            36: jexec $jid $SHELL