aboutsummaryrefslogtreecommitdiff
path: root/local
diff options
context:
space:
mode:
Diffstat (limited to 'local')
-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