+ deploy rclone config
plus better naming of gpg key deployer script
This commit is contained in:
@@ -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`)
|
- `syncDirSetup.sh` (will set up `~/syncDir`)
|
||||||
- `deploySshKeys.sh` (deployment of ssh keys)
|
- `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/`)
|
- `gitReposSoftlinker.sh` (create softlinks to all repos at `~/syncDir/gitRepos/`)
|
||||||
- `chmodAllSh.sh` (fixes mode change from 14001 to 217 errors in repo)
|
- `chmodAllSh.sh` (fixes mode change from 14001 to 217 errors in repo)
|
||||||
- `reboot` and re-login
|
- `reboot` and re-login
|
||||||
|
|||||||
32
dots/bin/deployRcloneCfg.sh
Executable file
32
dots/bin/deployRcloneCfg.sh
Executable file
@@ -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}
|
||||||
Reference in New Issue
Block a user