Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active January 5, 2025 02:29
Show Gist options
  • Save dewomser/ccf965d4c28d7c6d9c8e3e73c0ac3800 to your computer and use it in GitHub Desktop.
Save dewomser/ccf965d4c28d7c6d9c8e3e73c0ac3800 to your computer and use it in GitHub Desktop.
Bash und Webdav und Nextcloud. Eine Übung
#!/bin/bash
# Username und Passwort kann auch in ~/.netrc hinterlegt werden.
# -n, --netrc tells curl to look for and use the .netrc file.
echo "hin und her test" > test.txt
curl --user 'user:PW' -T 'test.txt' 'https://nc.my-nextcloud.de/remote.php/webdav/'
rm test.txt
curl --user 'user:PW' -X GET 'https://nc.my-nextcloud.de/remote.php/webdav/test.txt' -o 'test.txt'
curl --user 'user:PW' -X DELETE 'https://nc.my-nextcloud.de/remote.php/webdav/test.txt'
cat test.txt
rm test.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment