Wiki source code of Uploading a file list to a Confluence page
Version 2.1 by Normann P. Nielsen on 2026/11/15 15:43
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | This lists my movies - first in alfabetical order, then after timestamp (for the movie file) | ||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | On the NAS: | ||
| 6 | |||
| 7 | (A prerequisite in to have ssh keys configured) | ||
| 8 | |||
| 9 | |||
| 10 | {{code}} | ||
| 11 | #!/bin/bash | ||
| 12 | |||
| 13 | echo "NAS Movielist - My ripped DVD/BD collection \\\\ \\\\ {toc} \\\\ "> /tmp/wiki | ||
| 14 | |||
| 15 | echo "h1. Alfabetical " >> /tmp/wiki | ||
| 16 | ls /media/Movies/ | sed 's/.m4v//g' >> /tmp/wiki | ||
| 17 | |||
| 18 | echo "h1. By timestamp (new -> old) " >> /tmp/wiki | ||
| 19 | ls -t /media/Movies/ | sed 's/.m4v//g' >> /tmp/wiki | ||
| 20 | |||
| 21 | ssh myserver.site.dk "~/scripts/addPageContent.sh familieblog 'Movielist for my NAS' '`cat /tmp/wiki`'" | ||
| 22 | {{/code}} | ||
| 23 | |||
| 24 | |||
| 25 | |||
| 26 | On the Confluence Server: | ||
| 27 | |||
| 28 | (A prerequisite is to have the [[Atlassian CLI>>Main.atlassian.atlassian-confluence.atlassian-cli]] configured) | ||
| 29 | |||
| 30 | {{success}}This is generic, hence can be used for all sorts of Page updates{{/success}} | ||
| 31 | |||
| 32 | |||
| 33 | {{code language="AddPageContent.sh"}} | ||
| 34 | #!/bin/bash | ||
| 35 | |||
| 36 | Space=$1 | ||
| 37 | PageTitle=$2 | ||
| 38 | html=$3 | ||
| 39 | |||
| 40 | /opt/atlassian-cli/confluence.sh --action storePage --space "$Space" --title "$PageTitle" --content "$html" | ||
| 41 | {{/code}} |