+ rclone, gitRepos.sh
ulozto, uloz.to
This commit is contained in:
37
dots/bin/gitRepos.sh
Executable file
37
dots/bin/gitRepos.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# klevstul :: 26.04
|
||||
|
||||
gitRepos() {
|
||||
mnt_dir=/mnt/gitRepos
|
||||
if ! [[ -d ${mnt_dir} ]]; then
|
||||
echo "creating non-existing mount dir '${mnt_dir}'."
|
||||
sudo mkdir -p ${mnt_dir}
|
||||
sudo chown ${USER}:${USER} ${mnt_dir}
|
||||
elif [[ ! -d ${mnt_dir} ]] ; then
|
||||
echo "'${mnt_dir}' exist, but is not a directory" 1>&2
|
||||
fi
|
||||
|
||||
if [[ -n $1 ]] ; then
|
||||
if [[ $1 == "umount" ]] || [[ $1 == "unmount" ]] ; then
|
||||
echo "umount ${mnt_dir}"
|
||||
sudo umount -l /mnt/gitRepos
|
||||
elif [[ $1 == "mount" ]] ; then
|
||||
echo "mount ${mnt_dir}"
|
||||
rclone mount --vfs-cache-mode full ulozto:gitRepos /mnt/gitRepos &
|
||||
else
|
||||
echo "unknown command. try: 'gitRepos {mount,umount}'"
|
||||
fi
|
||||
else
|
||||
echo "sry, bud! try: 'gitRepos {mount,umount}'"
|
||||
fi
|
||||
}
|
||||
|
||||
this_file_name=`basename "$0"`
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "error: operation {mount|umount} is missing."
|
||||
echo "usage: '$this_file_name {mount|umount}'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gitRepos $1
|
||||
Reference in New Issue
Block a user