aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinstall2
-rwxr-xr-xlocal/bin/cloud26
2 files changed, 28 insertions, 0 deletions
diff --git a/install b/install
index d0b26b3..f8f2b7b 100755
--- a/install
+++ b/install
@@ -98,6 +98,8 @@ if ask "sync" "Install synchronization"; then
inst config/khal/config ~/.config/khal/config
inst config/khard/khard.conf ~/.config/khard/khard.conf
+ inst local/bin/cloud ~/.local/bin/cloud
+
inst_sync
fi
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