3 [ $(id -u) = 0 ] || exec sudo $0 $@
4 . $(dirname $(realpath $0))/functions XXX
8 if [ -z "$NAME" ] ; then
9 echo "Select subhost: $(list_running)"
13 read USPID RSPID <<EOF
17 [ -z "$USPID" ] && echo "$NAME is not running" >&2 && exit 1
19 if [ -z "$RSPID" ] ; then
21 *** $NAME is started (pid $USPID) but doesn't seem to be running
22 *** /.reaper and might need manual fixing.
27 sudo nsenter -t "$RSPID" -n -m -p -r -w -u -C /bin/bash
28 if [ $? = 137 ] ; then
29 echo "######### please 'fg' this again (if stopped)" >&2
30 stty sane # a killed bash might leave the tty insane and stty
31 # typically gets stopped trying to correct it