|
|
|
@ -29,7 +29,6 @@ function parse_options { |
|
|
|
shift 1 # Move to the next argument |
|
|
|
done |
|
|
|
[[ -n $CONTAINER ]] || (usage && exit 1) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function before_start { |
|
|
|
@ -43,16 +42,18 @@ function before_start { |
|
|
|
|
|
|
|
function after_start { |
|
|
|
# hot changes |
|
|
|
if [[ -v MIAOU_BASH_DIR ]]; then |
|
|
|
pct exec "$CONTAINER_ID" -- /opt/miaou-bash/install.sh |
|
|
|
fi |
|
|
|
pct exec "$CONTAINER_ID" -- apt-get purge -y postfix |
|
|
|
pct exec "$CONTAINER_ID" -- apt-get update |
|
|
|
pct exec "$CONTAINER_ID" -- apt-get install -y sudo |
|
|
|
pct exec "$CONTAINER_ID" -- apt-get install -y file git bc vim jq sudo bash-completion |
|
|
|
if [[ -v MIAOU_BASH_DIR ]]; then |
|
|
|
pct exec "$CONTAINER_ID" -- /opt/miaou-bash/init.sh |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
function create { |
|
|
|
CONTAINER_ID=$(pct-create $CONTAINER --no-start | grep "container: $CONTAINER succesfully created" | cut -d= -f2 | cut -d! -f1) |
|
|
|
[[ -z $CONTAINER_ID ]] && echo -e "Unable to create container: $CONTAINER\nMight already exists?" && exit 10 |
|
|
|
|
|
|
|
before_start |
|
|
|
pct start $CONTAINER_ID |
|
|
|
after_start |
|
|
|
|