#!/bin/bash

VZLIST="/usr/sbin/vzlist"
VERSION=1

VEROOT=$1
VEID=$2

function error_msg() {
	echo $*
	exit 1
}

# Check for needed features
$VZLIST -H -o features $VEID 2>/dev/null | grep 'bridge:off' > /dev/null 2>&1
[ $? -eq 0 ] && error_msg "Failed to install docker template: feature bridge should be on"

$VZLIST -H -o netfilter $VEID 2>/dev/null | grep '^full' > /dev/null 2>&1
[ $? -ne 0 ] && error_msg "Failed to install docker template: netfilter should be full"

exit 0
