diff options
author | Karel Kočí <cynerd@email.cz> | 2025-05-09 15:07:44 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2025-05-09 15:07:44 +0200 |
commit | 5fe3e95070771da446d95a496e269d03f1b3082e (patch) | |
tree | 41992756ebe04b80393fecfdf5cf55f87de28522 | |
parent | b56637cfb959d5662b10eeb0bba334420072f829 (diff) | |
download | myconfigs-5fe3e95070771da446d95a496e269d03f1b3082e.tar.gz myconfigs-5fe3e95070771da446d95a496e269d03f1b3082e.tar.bz2 myconfigs-5fe3e95070771da446d95a496e269d03f1b3082e.zip |
Add cloud script
-rwxr-xr-x | install | 2 | ||||
-rwxr-xr-x | local/bin/cloud | 26 |
2 files changed, 28 insertions, 0 deletions
@@ -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 |