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

24 lines
429 B
Bash
Raw Normal View History

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