Changeset 1172 for dasscm/trunk/usr/bin


Ignore:
Timestamp:
Jun 2, 2014, 3:44:03 PM (10 years ago)
Author:
joergs
Message:

improved argument handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dasscm/trunk/usr/bin/dasscm_remote_update.sh

    r1167 r1172  
    2222}
    2323
    24 OPTIONS=${DASSCM_RSYNC_OPTIONS:-""}
     24OPTIONS="${DASSCM_RSYNC_OPTIONS:-}"
    2525REMOTE_USER=${DASSCM_REMOTE_USER:-"root"}
    2626
     
    4444svn ls -R > $FILELIST
    4545SERVER=`basename "$PWD"`
    46 rsync -av --checksum --existing --files-from $FILELIST $OPTIONS $REMOTE_USER@$SERVER:/. . || (echo "FAILED to transfer dasscm files. Failed to access server $SERVER via ssh/rsync?"; usage)
     46RESULT=1
     47if [ "$OPTIONS" ]; then
     48    rsync -av --checksum --existing --files-from $FILELIST "$OPTIONS" $REMOTE_USER@$SERVER:/. .
     49    RESULT=$?
     50else
     51    rsync -av --checksum --existing --files-from $FILELIST $REMOTE_USER@$SERVER:/. .
     52    RESULT=$?
     53fi
     54if [ "$RESULT" -gt 0 ]; then
     55    echo "FAILED to transfer dasscm files. Failed to access server $SERVER via ssh/rsync?"
     56    usage
     57fi
    4758rm $FILELIST
    4859echo "updated file must be commited manually"
Note: See TracChangeset for help on using the changeset viewer.