mooooore stuffs
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# CONTAINER=$(cat "/home/${USER}/.lxc-container" 2>/dev/null)
|
||||
CONTAINER=$(cat "/home/$(whoami)/.lxc-container" 2>/dev/null)
|
||||
|
||||
if [[ -z "$CONTAINER" ]]; then
|
||||
echo "No container assigned. Contact admin."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ensure running
|
||||
lxc-start -n "$CONTAINER" 2>/dev/null || true
|
||||
|
||||
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
|
||||
exec lxc-attach -n "$CONTAINER" -- bash -c "$SSH_ORIGINAL_COMMAND"
|
||||
else
|
||||
exec lxc-attach -n "$CONTAINER" -- login -f root
|
||||
fi
|
||||
Reference in New Issue
Block a user