aboutsummaryrefslogtreecommitdiff
path: root/local/bin/cloud
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2025-05-09 15:07:44 +0200
committerKarel Kočí <cynerd@email.cz>2025-05-09 15:07:44 +0200
commit5fe3e95070771da446d95a496e269d03f1b3082e (patch)
tree41992756ebe04b80393fecfdf5cf55f87de28522 /local/bin/cloud
parentb56637cfb959d5662b10eeb0bba334420072f829 (diff)
downloadmyconfigs-5fe3e95070771da446d95a496e269d03f1b3082e.tar.gz
myconfigs-5fe3e95070771da446d95a496e269d03f1b3082e.tar.bz2
myconfigs-5fe3e95070771da446d95a496e269d03f1b3082e.zip
Add cloud script
Diffstat (limited to 'local/bin/cloud')
-rwxr-xr-xlocal/bin/cloud26
1 files changed, 26 insertions, 0 deletions
diff --git a/local/bin/cloud b/local/bin/cloud
new file mode 100755
index 0000000..db6e717
--- /dev/null
+++ b/local/bin/cloud
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+path="/media/cloud"
+
+usage() {
+ echo "Usage: $0 [OPTION].." >&2
+}
+
+umount="n"
+while getopts "u" opt; do
+ case "$opt" in
+ u)
+ umount="y"
+ ;;
+ *)
+ usage
+ exit 2
+ ;;
+ esac
+done
+
+if [ "$umount" = "n" ]; then
+ sudo mkdir -p "$path"
+ sudo mount.davfs -o uid=1000,username=cynerd "https://cloud.cynerd.cz/remote.php/dav/files/cynerd" "$path"
+else
+ sudo umount "$path"
+fi