diff options
-rw-r--r-- | files/sync-media-init | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/files/sync-media-init b/files/sync-media-init index e16dbf0..035da02 100644 --- a/files/sync-media-init +++ b/files/sync-media-init @@ -1,13 +1,12 @@ #!/bin/bash # -# Add git-annex remotes to repository in removable media. +# Add git-annex remotes to repository in removable media or local cache. # # Parameters BASENAME="`basename $0`" VOLUME="$1" DOMAIN="`facter DOMAIN`" -MEDIA="/media/$VOLUME/media.$DOMAIN" #REMOTE_BOXES="" #REMOTE_VOLUMES="" @@ -17,6 +16,13 @@ if [ -z "$VOLUME" ]; then exit 1 fi +# Determine media folder +if [ "$VOLUME" == "`facter hostname`" ]; then + MEDIA="/var/cache/media" +else + MEDIA="/media/$VOLUME/media.$DOMAIN" +fi + # Process each repository for file in `ls $MEDIA`; do if [ -d "$MEDIA/$file/.git/annex" ]; then |