From df0c6345c06ab7f52e50f4684a52fe0ff40115d3 Mon Sep 17 00:00:00 2001 From: "committer@tuxwarrior" Date: Sat, 4 Apr 2026 17:21:57 -0500 Subject: [PATCH] + rclone, gitRepos.sh ulozto, uloz.to --- dots/bin/deployRcloneCfg.sh | 12 +++++++----- dots/bin/gitRepos.sh | 37 +++++++++++++++++++++++++++++++++++++ dots/bin/startup.sh | 1 + 3 files changed, 45 insertions(+), 5 deletions(-) create mode 100755 dots/bin/gitRepos.sh diff --git a/dots/bin/deployRcloneCfg.sh b/dots/bin/deployRcloneCfg.sh index 2eb3006..c96297c 100755 --- a/dots/bin/deployRcloneCfg.sh +++ b/dots/bin/deployRcloneCfg.sh @@ -18,15 +18,17 @@ if ! [[ -d "$trg_dir" ]]; then mkdir -p ${trg_dir} fi -# copy from source to target if source does not exist - +# copy from source to target files=$(shopt -s nullglob dotglob; echo ${trg_dir}/*.conf) if (( ${#files} )) then - echo "*.conf file(s) already exist in ${trg_dir}" + echo "overwrite already existing *.conf file(s) in ${trg_dir}?" + read -n 1 -s -r -p "press any key to continue" + echo "" else - echo "deploy .conf file(s)" - cp ${src_file} ${trg_ssh_dir} + echo "deploying new *.conf file(s) to ${trg_dir}" fi +cp ${src_file} ${trg_dir} + ls -al ${trg_dir} diff --git a/dots/bin/gitRepos.sh b/dots/bin/gitRepos.sh new file mode 100755 index 0000000..f63f30f --- /dev/null +++ b/dots/bin/gitRepos.sh @@ -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 diff --git a/dots/bin/startup.sh b/dots/bin/startup.sh index a9ff906..535d445 100755 --- a/dots/bin/startup.sh +++ b/dots/bin/startup.sh @@ -10,6 +10,7 @@ hypropolkitagent & # au hypridle & # idle management deamon hyprpaper & # wallpaper nwg-panel & # status bar +gitRepos.sh mount & # mount gitRepos mount directory nm-applet & # network manager applet nextcloud & # nextcloud file sync