From f73adba35daa8e24b7f28dc73eb58f53761a0d3b Mon Sep 17 00:00:00 2001
From: Vivek Kumar Dutta <vivek.dutta@iopsys.eu>
Date: Tue, 8 Aug 2023 19:56:51 +0530
Subject: [PATCH] Added autostart in lxc template

---
 templates/lxc-iopsys | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/templates/lxc-iopsys b/templates/lxc-iopsys
index a1a324e..fe9c75d 100755
--- a/templates/lxc-iopsys
+++ b/templates/lxc-iopsys
@@ -414,7 +414,9 @@ fi
 uci_path=$(dirname "${path}")
 cfg=$(uci -c "${uci_path}" -q add lxccontainer container)
 if [ -n "${cfg}" ]; then
-	uci -c "${uci_path}" -q set lxccontainer."${cfg}".name="${name}"
-	uci -c "${uci_path}" -q set lxccontainer."${cfg}".type='lxc'
-	uci -c "${uci_path}" commit lxccontainer
+        uci -c "${uci_path}" -q set lxccontainer."${cfg}".name="${name}"
+        uci -c "${uci_path}" -q set lxccontainer."${cfg}".type='lxc'
+        uci -c "${uci_path}" -q set lxccontainer."${cfg}".autostart='1'
+        uci -c "${uci_path}" -q set lxccontainer."${cfg}".timeout='300'
+        uci -c "${uci_path}" commit lxccontainer
 fi
-- 
GitLab