-
-
Save emmaly/0715841f703c8eabb5c4b26248e9d73d to your computer and use it in GitHub Desktop.
OpenVZ helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # cd into a container on the host-side, optionally including a subdir within it | |
| function xcd() { | |
| VEID="$(vzlist "$1" | grep -v CTID | tr -s ' ' | cut -d' ' -f2)" | |
| shift | |
| [ -z "$VEID" ] && exit 1 | |
| cd /var/lib/vz/private/$VEID$* | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # helps to shut down and disable containers | |
| function xct() { | |
| VEID="$(vzlist "$1" | grep -v CTID | tr -s ' ' | cut -d' ' -f2)" | |
| [ -z "$VEID" ] && exit 1 | |
| sudo vzctl stop $VEID | |
| sudo vzctl set $VEID --save --onboot=no | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment