get-convert-licenses.sh 833 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # SPDX-License-Identifier: GPL-3.0-or-later
  3. set -e
  4. function txt_to_rtf() {
  5. INPUT="$1"
  6. OUTPUT="$2"
  7. echo '{\rtf1\ansi\deff0 {\fonttbl {\f0 Times New Roman;}}' > "$OUTPUT"
  8. echo '\paperh15840 \paperw12240' >> "$OUTPUT"
  9. echo '\margl720 \margr720 \margt720 \margb720' >> "$OUTPUT"
  10. echo '\f0\fs24' >> "$OUTPUT"
  11. sed s/\$/'\\line'/ "$INPUT" | sed s/\\f/'\\page'/ >> "$OUTPUT"
  12. echo '}' >> "$OUTPUT"
  13. }
  14. if [ ! -f "gpl-3.0.txt" ]; then
  15. curl -o gpl-3.0.txt "https://www.gnu.org/licenses/gpl-3.0.txt"
  16. fi
  17. if [ ! -f "cloud.txt" ]; then
  18. curl -o cloud.txt "https://raw.githubusercontent.com/netdata/netdata/master/src/web/gui/v2/LICENSE.md"
  19. fi
  20. if [ -f "gpl-3.0.txt" ] ; then
  21. txt_to_rtf "gpl-3.0.txt" "gpl-3.0.rtf"
  22. fi
  23. if [ -f "cloud.txt" ] ; then
  24. txt_to_rtf "cloud.txt" "cloud.rtf"
  25. fi