#!/bin/bash

. sbs/exec/config/allg
. $(dirname $BASH_SOURCE)/config/functions

netplan=$(findtemplate network netplan_single )
ids="file,config"
labels="Datei,Konfiguration";
regexps="file:notempty"

json_writeheader "$ids" "$labels" "" "" "$regexps";

echo '  "values"  : ['

for file in $(ls -1 "$netplandir")
do
  if [ "${file##*.}" == "yaml" ]; then
    json_writedata "${file%.*}" "$(cat "$netplandir/$file")"
  fi
done

echo ']'

exit 0
