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 /local/bin/cloud | |
parent | b56637cfb959d5662b10eeb0bba334420072f829 (diff) | |
download | myconfigs-5fe3e95070771da446d95a496e269d03f1b3082e.tar.gz myconfigs-5fe3e95070771da446d95a496e269d03f1b3082e.tar.bz2 myconfigs-5fe3e95070771da446d95a496e269d03f1b3082e.zip |
Add cloud script
Diffstat (limited to 'local/bin/cloud')
-rwxr-xr-x | local/bin/cloud | 26 |
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 |