0108fcf653
This patch modularize run.sh, adding two new helper scripts and make it possible to specify a git repository for ssh keys via a new env variable `BORG_SSHKEYS_REPO`. the modularization add two new files : - `env.sh` : define a few envriroment variables - `create-client-dirs.sh` : update and create user directories and re-create authorized_keys We also add a new script `update-ssh-keys.sh` to be called regurlarly in a cron job to check if the git repository is up-to-date and eventually adding/removing users.
18 lines
304 B
Bash
Executable file
18 lines
304 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
source env.sh
|
|
|
|
if [ -d "${SSH_KEY_DIR}/clients/.git" ] ; then
|
|
cd "${SSH_KEY_DIR}/clients" || exit 0
|
|
git fetch
|
|
if ! git diff --quiet remotes/origin/HEAD; then
|
|
echo "Pull from git repository"
|
|
git pull
|
|
create-client-dirs.sh
|
|
else
|
|
echo "$0: Nothing to do"
|
|
fi
|
|
fi
|