diff --git a/dist/share/configs/cellframe-node.cfg.tpl b/dist/share/configs/cellframe-node.cfg.tpl index 90f8930dc06a0fac07e5b0bae8fbc0c8e32b782d..f28ef0b181f123e1ec61f3a1479db7d5523188e2 100644 --- a/dist/share/configs/cellframe-node.cfg.tpl +++ b/dist/share/configs/cellframe-node.cfg.tpl @@ -135,7 +135,7 @@ path={PREFIX}/var/lib/global_db # Plugins #[plugins] -#enabled=true +enabled=true # Load Python-based plugins #py_load=true # Path to Pyhon-based plugins diff --git a/dist/share/configs/network/Backbone.cfg.tpl b/dist/share/configs/network/Backbone.cfg.tpl.dis similarity index 100% rename from dist/share/configs/network/Backbone.cfg.tpl rename to dist/share/configs/network/Backbone.cfg.tpl.dis diff --git a/dist/share/configs/network/kelvpn-minkowski.cfg.tpl b/dist/share/configs/network/kelvpn-minkowski.cfg.tpl.dis similarity index 100% rename from dist/share/configs/network/kelvpn-minkowski.cfg.tpl rename to dist/share/configs/network/kelvpn-minkowski.cfg.tpl.dis diff --git a/dist/share/configs/network/mileena.cfg.tpl b/dist/share/configs/network/mileena.cfg.tpl.dis similarity index 100% rename from dist/share/configs/network/mileena.cfg.tpl rename to dist/share/configs/network/mileena.cfg.tpl.dis diff --git a/dist/share/configs/network/private.cfg.tpl b/dist/share/configs/network/private.cfg.tpl.dis similarity index 100% rename from dist/share/configs/network/private.cfg.tpl rename to dist/share/configs/network/private.cfg.tpl.dis diff --git a/os/debian/postinst b/os/debian/postinst index a0499311a8a5cf810f51e39ea3b446eb69501c45..2a647170df9d60870de859b3ef8d8eb7e45d0131 100755 --- a/os/debian/postinst +++ b/os/debian/postinst @@ -93,20 +93,27 @@ NET_NAME="mileena" db_get cellframe-node/mileena_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" + mv "$DAP_CFG_NET" "$DAP_CFG_NET".dis + echo "[*] Disabled meelena" fi - - cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true - db_get cellframe-node/mileena_node_type || true - NODE_TYPE=$RET - sed -i "s/{NODE_TYPE}/$NODE_TYPE/g" $DAP_NET_CFG || true - echo "[*] Enabled mileena" + +# 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/mileena_node_type || true +# NODE_TYPE=$RET +# sed -i "s/{NODE_TYPE}/$NODE_TYPE/g" $DAP_NET_CFG || true +# echo "[*] Enabled mileena" fi # Init Minkowski @@ -114,20 +121,27 @@ NET_NAME="kelvpn-minkowski" db_get cellframe-node/kelvpn_minkowski_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" + mv "$DAP_CFG_NET" "$DAP_CFG_NET".dis + echo "[*] Disabled kelvpn" fi - - cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true - db_get cellframe-node/kelvpn_minkowski_node_type || true - NODE_TYPE=$RET - sed -i "s/{NODE_TYPE}/$NODE_TYPE/g" $DAP_NET_CFG || true - echo "[*] Enabled subzero" + +# 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/kelvpn_minkowski_node_type || true +# NODE_TYPE=$RET +# sed -i "s/{NODE_TYPE}/$NODE_TYPE/g" $DAP_NET_CFG || true +# echo "[*] Enabled subzero" fi # Init Backbone @@ -135,20 +149,28 @@ NET_NAME="Backbone" db_get cellframe-node/backbone_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" + mv "$DAP_CFG_NET" "$DAP_CFG_NET".dis + echo "[*] Disabled Backbone" fi + - cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true - db_get cellframe-node/backbone_node_type || true - NODE_TYPE=$RET - sed -i "s/{NODE_TYPE}/$NODE_TYPE/g" $DAP_NET_CFG || true - echo "[*] Enabled Backbone" + #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/backbone_node_type || true + #NODE_TYPE=$RET + #sed -i "s/{NODE_TYPE}/$NODE_TYPE/g" $DAP_NET_CFG || true + #echo "[*] Enabled Backbone" fi mkdir -p $DAP_PREFIX/var/log || true diff --git a/scripts/create_configs_from_tpl.sh b/scripts/create_configs_from_tpl.sh index f7f98dc118290ea59d62d9f28a8bdab2c2467e20..f3833ebe15f701d1785f54602580d46dad1d6ca6 100755 --- a/scripts/create_configs_from_tpl.sh +++ b/scripts/create_configs_from_tpl.sh @@ -50,23 +50,32 @@ rm $DAP_CFG.old NET_NAME="Backbone" if [ "$DAP_BACKBONE_ENABLED" = "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.new" - else - DAP_NET_CFG="$DAP_PREFIX/etc/network/$NET_NAME.cfg" + mv "$DAP_CFG_NET" "$DAP_CFG_NET".dis + echo "[*] Disabled Backbone" fi - cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true - sed -i .old "s/{NODE_TYPE}/$DAP_BACKBONE_ROLE/" $DAP_NET_CFG || true - rm $DAP_NET_CFG.old + +# 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.new" +# else +# DAP_NET_CFG="$DAP_PREFIX/etc/network/$NET_NAME.cfg" +# fi + +# cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true +# sed -i .old "s/{NODE_TYPE}/$DAP_BACKBONE_ROLE/" $DAP_NET_CFG || true +# rm $DAP_NET_CFG.old fi NET_NAME="subzero" if [ "$DAP_SUBZERO_ENABLED" = "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="" @@ -102,35 +111,50 @@ fi NET_NAME="kelvpn-minkowski" if [ "$DAP_KELVPN_MINKOWSKI_ENABLED" = "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.new" - else - DAP_NET_CFG="$DAP_PREFIX/etc/network/$NET_NAME.cfg" + mv "$DAP_CFG_NET" "$DAP_CFG_NET".dis + echo "[*] Disabled kelvpn" fi - cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true - sed -i .old "s/{NODE_TYPE}/$DAP_KELVPN_MINKOWSKI_ROLE/" $DAP_NET_CFG || true - rm $DAP_NET_CFG.old +# 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.new" +# else +# DAP_NET_CFG="$DAP_PREFIX/etc/network/$NET_NAME.cfg" + # fi + +# cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true +# sed -i .old "s/{NODE_TYPE}/$DAP_KELVPN_MINKOWSKI_ROLE/" $DAP_NET_CFG || true +# rm $DAP_NET_CFG.old + fi NET_NAME="mileena" if [ "$DAP_MILEENA_ENABLED" = "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.new" - else - DAP_NET_CFG="$DAP_PREFIX/etc/network/$NET_NAME.cfg" + mv "$DAP_CFG_NET" "$DAP_CFG_NET".dis + echo "[*] Disabled meleena" fi - cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true - sed -i .old "s/{NODE_TYPE}/$DAP_MILEENA_ROLE/" $DAP_NET_CFG || true - rm $DAP_NET_CFG.old + #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.new" + #else + #DAP_NET_CFG="$DAP_PREFIX/etc/network/$NET_NAME.cfg" + #fi + + #cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true + #sed -i .old "s/{NODE_TYPE}/$DAP_MILEENA_ROLE/" $DAP_NET_CFG || true + #rm $DAP_NET_CFG.old fi chmod 0666 $DAP_CFG