Falls es wer brauchen kann
Bash:
#!/bin/bash
rm delete.txt create.txt existingdomainsraw.txt existingdomainspmg.txt
pmgsh get /config/domains/ | grep domain | cut -d ":" -f 2 | awk '{print substr($0,3,length($0)-3)}' > existingdomainsraw.txt && tail -n +1 existingdomainsraw.txt > existingdomainspmg.txt
#müssen angelegt werden
diff --left-column --changed-group-format="%>" --unchanged-group-format="" existingdomainspmg.txt existingdomainsexternalsource.txt > create.txt
#müssen gelöscht werden
diff --left-column --changed-group-format="%>" --unchanged-group-format="" existingdomainsexternalsource.txt existingdomainspmg.txt > delete.txt
while read i ; do pmgsh create /config/domains/ --comment "create" --domain $i ; done < create.txt
while read i ; do pmgsh delete /config/domains/$i ; done < delete.txt