Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active February 17, 2026 17:47
Show Gist options
  • Select an option

  • Save dewomser/ccf965d4c28d7c6d9c8e3e73c0ac3800 to your computer and use it in GitHub Desktop.

Select an option

Save dewomser/ccf965d4c28d7c6d9c8e3e73c0ac3800 to your computer and use it in GitHub Desktop.
Bash und Webdav und Nextcloud. Eine Übung
#!/bin/bash
# Username und Passwort in ~/.netrc hinterlegen.
# -n, --netrc tells curl to look for and use the ~.netrc file.
#Dieses Skript ist miaufähig.
miau() {
printf '%s' "$(<"$1")"
}
echo "hin und her test" > test.txt
# curl --user 'user:PW' - oder -n
curl -n -T test.txt "https://nc.stefan-höhn.de/remote.php/dav/files/admin/test.txt"
echo "nachNC übertragen"
rm test.txt
sleep 2
# curl --user 'user:PW' - oder -n
curl -n -X GET 'https://nc.stefan-höhn.de/remote.php/dav/files/admin/test.txt' -o 'test.txt'
echo "von NC zurück kopieren"
sleep 2
# curl --user 'user:PW' - oder -n
curl -n -X DELETE https://nc.stefan-höhn.de/remote.php/dav/files/admin/test.txt
echo "von NC löschen"
#cat test.txt
# ihr sollt micht cat nehmen um eine Tetxtdatei anzuzeigen !
# mehr info zu miau : https://gist.github.com/dewomser/736b0ea045905c5923b5a5daa05a6f98
miau test.txt
rm test.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment