vagrant-lxc-base-boxes/common/utils.sh

24 lines
438 B
Bash
Raw Normal View History

2014-03-25 03:26:19 +00:00
#!/bin/bash
utils.lxc.attach() {
cmd="$@"
log "Running [${cmd}] inside '${CONTAINER}' container..."
(lxc-attach -n ${CONTAINER} -- $cmd) & >> ${LOG}
2014-03-25 03:26:19 +00:00
}
utils.lxc.start() {
lxc-start -d -n ${CONTAINER} & >> ${LOG} || true
2014-03-25 03:26:19 +00:00
}
utils.lxc.stop() {
lxc-stop -n ${CONTAINER} & >> ${LOG} || true
2014-03-25 03:26:19 +00:00
}
utils.lxc.destroy() {
lxc-destroy -n ${CONTAINER} & >> ${LOG}
2014-03-25 03:26:19 +00:00
}
utils.lxc.create() {
lxc-create -n ${CONTAINER} "$@" & >> ${LOG}
2014-03-25 03:26:19 +00:00
}