exit 1
fi
-if [ -f "$lxc_path/$lxc_name" ]; then
+if [ -d "$lxc_path/$lxc_name" ]; then
echo "'$lxc_name' already exists"
exit 1
fi
+mkdir -p $lxc_path/$lxc_name
+
if [ -z "$lxc_config" ]; then
- touch $lxc_path/$lxc_name
+ touch $lxc_path/$lxc_name/config
else
if [ ! -r "$lxc_config" ]; then
echo "'$lxc_config' configuration file not found"
exit 1
fi
- cp $lxc_config $lxc_path/$lxc_name
+ cp $lxc_config $lxc_path/$lxc_name/config
fi
\ No newline at end of file
exit 1
fi
-if [ ! -f "$lxc_path/$lxc_name" ]; then
+if [ ! -d "$lxc_path/$lxc_name" ]; then
echo "'$lxc_name' does not exist"
exit 1
fi
if (my_args.rcfile)
rcfile = (char *)my_args.rcfile;
else {
- if (!asprintf(&rcfile, LXCPATH "/%s", my_args.name)) {
+ if (!asprintf(&rcfile, LXCPATH "/%s/config", my_args.name)) {
SYSERROR("failed to allocate memory");
return -1;
}
if (my_args.rcfile)
rcfile = (char *)my_args.rcfile;
else {
- if (!asprintf(&rcfile, LXCPATH "/%s", my_args.name)) {
+ if (!asprintf(&rcfile, LXCPATH "/%s/config", my_args.name)) {
SYSERROR("failed to allocate memory");
return err;
}