diff --git a/linux/debian/essentials/postinst b/linux/debian/essentials/postinst index 29e13ad5c33f5706674a2a1b4bcfafbd972d7974..36deecfe0651184d108c0730b3b247e62c185302 100755 --- a/linux/debian/essentials/postinst +++ b/linux/debian/essentials/postinst @@ -87,6 +87,27 @@ if [ "$RET" = "true" ]; then echo "[*] Enabled kelvin testnet" fi +# Init subzero +NET_NAME="subzero" + +db_get cellframe-node/subzero_enabled || true +if [ "$RET" = "true" ]; then + DAP_CFG_NET="$DAP_PREFIX/etc/network/$NET_NAME.cfg" + DAP_CFG_NET_TPL="$DAP_PREFIX/share/configs/network/$NET_NAME.cfg.tpl" + DAP_NET_CFG="" + if [ -e "$DAP_CFG_NET" ]; then + DAP_NET_CFG="$DAP_PREFIX/etc/network/$NET_NAME.cfg.dpkg-new" + else + DAP_NET_CFG="$DAP_PREFIX/etc/network/$NET_NAME.cfg" + fi + + cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true + db_get cellframe-node/subzero_node_type || true + NODE_TYPE=$RET + sed -i "s/{NODE_TYPE}/$NODE_TYPE/g" $DAP_NET_CFG || true + echo "[*] Enabled subzero" +fi + mkdir -p $DAP_PREFIX/var/log || true mkdir -p $DAP_PREFIX/var/plugins || true