LXC-Restart.SH

This page has been deleted, most likely because it does not belong on the snippets wiki.
View Source | Edit Page


Creator: MichaelWClarkMichaelWClark

Description

Stop then start LXC instance. Show LXC Info after started.

Code

#!/bin/bash
# Run as root on host of container
# Argument 1 - container name
#
# Stops, Starts, then displays LXC-Info

lxc=$1

if [ -d /var/lib/lxc/$lxc ]; then
    lxc-stop $lxc
    lxc-start -d -n $lxc
    lxc-info $lxc
else
    echo "LXC $lxc does not exist!"
fi

Comments

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License