set -e
+# Only run on a normally configured ubuntu lxc system
+if [ ! -d /sys/class/net/lxcbr0 ]; then
+ echo "lxcbr0 is not configured."
+ exit 1
+fi
+if [ "$(id -u)" != "0" ]; then
+ echo "ERROR: Must run as root."
+ exit 1
+fi
+
if [ -f /proc/self/ns/cgroup ]; then
default_profile="lxc-container-default-cgns (enforce)"
else
trap cleanup exit
-# Only run on a normally configured ubuntu lxc system
-if [ ! -d /sys/class/net/lxcbr0 ]; then
- echo "lxcbr0 is not configured."
- exit 1
-fi
-if [ "$(id -u)" != "0" ]; then
- echo "ERROR: Must run as root."
- exit 1
-fi
-
chmod 0666 "$logfile"
# This would be much simpler if we could run it as