aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-04-18 12:59:35 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-04-18 12:59:35 -0300
commitdfc22eff6a7296d62164da0577725a51d31ee18d (patch)
tree9458dde5039c9489824a0f84cebee4ab401b553a /files
parent0618f455869e7ceb9ea2892dfe3dd7ab44593fcf (diff)
downloadpuppet-backup-dfc22eff6a7296d62164da0577725a51d31ee18d.tar.gz
puppet-backup-dfc22eff6a7296d62164da0577725a51d31ee18d.tar.bz2
Adding sync_media_identity into sync-media-init
Diffstat (limited to 'files')
-rw-r--r--files/sync-media-init10
1 files changed, 10 insertions, 0 deletions
diff --git a/files/sync-media-init b/files/sync-media-init
index 2a3f42a..b32e88c 100644
--- a/files/sync-media-init
+++ b/files/sync-media-init
@@ -13,6 +13,15 @@ CACHES=""
VOLUMES=""
BOXES=""
+# Fix identity
+function sync_media_identity {
+ if [ -z "`git config --local user.email`" ] || [ -z "`git config --local user.name`" ]; then
+ repo="$(basename `pwd`)"
+ git config user.name "${repo^} Asset Manager"
+ git config user.email "$repo@assset.manager"
+ fi
+}
+
# Syntax check
if [ -z "$VOLUME" ]; then
echo "usage: $BASENAME <volume> [<caches|volumes|boxes> [remotes]]"
@@ -45,6 +54,7 @@ for file in `ls $MEDIA`; do
(
echo Processing "$MEDIA/$file..."
cd $MEDIA/$file
+ sync_media_identity
if git remote | grep -q "^origin$"; then
echo "Removing origin..."