diff --git a/README.md b/README.md index 9a2b6fd..47bb05a 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,8 @@ please note, this step is only needed when arch is to be installed on a new host - `syncDirSetup.sh` (will set up `~/syncDir`) - `deploySshKeys.sh` (deployment of ssh keys) -- `importGnupgKeys.sh` (deployment of gpg keys) +- `deployGnupgKeys.sh` (deployment of gpg keys) +- `deployRcloneCfg.sh` (deployment of rclone config) - `gitReposSoftlinker.sh` (create softlinks to all repos at `~/syncDir/gitRepos/`) - `chmodAllSh.sh` (fixes mode change from 14001 to 217 errors in repo) - `reboot` and re-login diff --git a/dots/bin/importGnupgKeys.sh b/dots/bin/deployGnupgKeys.sh similarity index 100% rename from dots/bin/importGnupgKeys.sh rename to dots/bin/deployGnupgKeys.sh diff --git a/dots/bin/deployRcloneCfg.sh b/dots/bin/deployRcloneCfg.sh new file mode 100755 index 0000000..2eb3006 --- /dev/null +++ b/dots/bin/deployRcloneCfg.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +# klevstul :: 26.04 + +this_file_name=`basename "$0"` +echo "$this_file_name" + +# source config file +src_file=/home/${USER}/syncDir/secrets/rclone/rclone.conf +if ! [[ -f ${src_file} ]]; then + echo "error: non-existing file '${src_file}'" >&2; exit 1 +fi + +# target directory +trg_dir=/home/${USER}/.config/rclone +if ! [[ -d "$trg_dir" ]]; then + echo "creating non-existing target dir '${trg_dir}'." + mkdir -p ${trg_dir} +fi + +# copy from source to target if source does not exist + +files=$(shopt -s nullglob dotglob; echo ${trg_dir}/*.conf) +if (( ${#files} )) +then + echo "*.conf file(s) already exist in ${trg_dir}" +else + echo "deploy .conf file(s)" + cp ${src_file} ${trg_ssh_dir} +fi + +ls -al ${trg_dir}