diff --git a/README.md b/README.md index 3df4f41..502a88a 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ $HOME/Documents/certificates/ | Contains certificates to authenticate via [certi | $HOME/Documents/recovery_codes/ | Contains files with recovery_codes e.g. for [Two-factor authentication](https://en.wikipedia.org/wiki/Multi-factor_authentication). | | $HOME/Documents/identity/ | Contains files to prove the identity of the *Core System Owner* in physical live like passports. | | $HOME/Documents/passwords/ | Contains e.g the [KeePassXC](https://keepassxc.org/) database with all *Core System Owner* passwords. | +| $HOME/Documents/repositories/ | Contains all git repositories | ### Functions @@ -51,6 +52,8 @@ $HOME/Documents/certificates/ | Contains certificates to authenticate via [certi | ```bash ./scripts/export-data-to-system.sh``` | Export data to the host system.| | ```bash ./scripts/unlock.sh``` | Unlock the stored data.| | ```bash ./scripts/lock.sh``` | Lock the stored data | +| ```bash ./scripts/pull-local-repositories.sh``` | Pulls all local repositories branches | +| ```bash ./scripts/pushs-local-repositories.sh``` | Pushs all local repositories branches | | ```encfsctl passwd .encrypted``` | Change the password of the encrypted folder. | ## License diff --git a/scripts/base.sh b/scripts/base.sh index 2fd6f96..ed293ce 100644 --- a/scripts/base.sh +++ b/scripts/base.sh @@ -10,4 +10,5 @@ DECRYPTED_PATH="$REPOSITORY_PATH/decrypted"; SCRIPT_PATH="$REPOSITORY_PATH/scripts"; DATA_PATH="$DECRYPTED_PATH/data"; BACKUP_PATH="$DECRYPTED_PATH/backup"; -TEMPLATE_PATH="$REPOSITORY_PATH/templates" +TEMPLATE_PATH="$REPOSITORY_PATH/templates"; +LOCAL_REPOSITORIES_PATH="$HOME/Documents/repositories"; diff --git a/scripts/import-data-from-system.sh b/scripts/import-data-from-system.sh index 52ee685..678863d 100644 --- a/scripts/import-data-from-system.sh +++ b/scripts/import-data-from-system.sh @@ -27,7 +27,6 @@ declare -a BACKUP_LIST=("$HOME/.ssh/" \ "$HOME/Documents/recovery_codes/" \ "$HOME/Documents/identity/" \ "$HOME/Documents/passwords/" \ - "$HOME/Documents/repositories/application" \ "$HOME/.local/share/rhythmbox/rhythmdb.xml" \ "$HOME/.config/keepassxc/keepassxc.ini"); for system_item_path in "${BACKUP_LIST[@]}"; diff --git a/scripts/pull-local-repositories.sh b/scripts/pull-local-repositories.sh new file mode 100644 index 0000000..6958b30 --- /dev/null +++ b/scripts/pull-local-repositories.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Pushs all repositories +# @author Kevin Veen-Birkenbach [aka. Frantz] +source "$(dirname "$(readlink -f "${0}")")/base.sh" +bash "$SCRIPT_PATH/push-local-repositories.sh" push diff --git a/scripts/push-local-repositories.sh b/scripts/push-local-repositories.sh new file mode 100644 index 0000000..02faada --- /dev/null +++ b/scripts/push-local-repositories.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# +# Pushs all repositories +# @param $1 git command which should be executed instead of default pull +# @author Kevin Veen-Birkenbach [aka. Frantz] +source "$(dirname "$(readlink -f "${0}")")/base.sh" +if [ $# -eq 1 ] + then + git_command=$1 + else + git_command="push" +fi +find $LOCAL_REPOSITORIES_PATH -maxdepth 1 -mindepth 1 -type d -exec bash -c "(cd {} && echo 'In directory: {}' && git status && echo 'Executes git $git_command' && git $git_command --all)" \;