You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
519 B
27 lines
519 B
#!/bin/sh
|
|
|
|
[ $(id -u) = 0 ] || exec sudo $0 $@
|
|
. $(dirname $(realpath $0))/functions XXX
|
|
|
|
NAME="$1"
|
|
|
|
if [ -z "$NAME" ] ; then
|
|
echo "Select subhost: $(list_running)"
|
|
exit 0
|
|
fi
|
|
|
|
read USPID RSPID <<EOF
|
|
$(is_live $NAME)
|
|
EOF
|
|
|
|
[ -z "$USPID" ] && echo "$NAME is not running" >&2 && exit 1
|
|
|
|
if [ -z "$RSPID" ] ; then
|
|
cat <<EOF >&2
|
|
*** $NAME is started (pid $USPID) but doesn't seem to be running
|
|
*** /.reaper and might need manual fixing.
|
|
EOF
|
|
exit 1
|
|
fi
|
|
|
|
sudo nsenter -t "$RSPID" -n -m -p -r -w -u -C /bin/bash
|
|
|