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.
26 lines
343 B
26 lines
343 B
#!/usr/bin/env bash
|
|
|
|
# CONSTANTS
|
|
|
|
BASEDIR=$(dirname "$0")
|
|
CONTAINER_NAME=$1
|
|
|
|
# FUNCTIONS
|
|
|
|
function usage {
|
|
echo "$(basename "$0") <CONTAINER_NAME>"
|
|
}
|
|
|
|
function status {
|
|
if vmid=$($BASEDIR/pct-lookup $CONTAINER_NAME); then
|
|
pct status $vmid | cut -d ' ' -f2
|
|
else
|
|
exit 10
|
|
fi
|
|
}
|
|
|
|
# MAIN
|
|
|
|
set -Eue
|
|
[[ "$#" -lt 1 ]] && usage && exit 1
|
|
status
|