Changes between Version 2 and Version 3 of S3QLMnt


Ignore:
Timestamp:
Oct 8, 2015, 12:30:49 PM (3 years ago)
Author:
chris
Comment:

Updated unmounting script, see ticket:39#comment:1

Legend:

Unmodified
Added
Removed
Modified
  • S3QLMnt

    v2 v3  
    88
    99{{{
     10#!bash
    1011#!/bin/bash
    1112
     
    5859
    5960{{{
     61#!bash
    6062#!/bin/bash
    6163
     
    7476fi
    7577
    76 # check for bucket name / directory on standard input
    77 if [[ $1 ]]; then
    78   BUCKET=$1
    79 elif [[ ! $1 ]]; then
    80   echo "Type the bucketname and then [ENTER]:"
    81   read bucket
    82   BUCKET=$bucket
     78# check for the number of arguments
     79if [[ "$2" ]]; then
     80  if [[ "$1" == "--force" ]]; then
     81    # force needed
     82    FORCE="1"
     83    BUCKET="$2"
     84  else
     85    echo "Please use this command like this: $0 --force bucketname"
     86    exit 0
     87  fi
     88else
     89  # check for bucket name / directory on standard input
     90  if [[ "$1" ]]; then
     91    BUCKET="$1"
     92  elif [[ ! "$1" ]]; then
     93    echo "Type the bucketname and then [ENTER]:"
     94    read bucket
     95    BUCKET=$bucket
     96  fi
    8397fi
    8498
    8599# if force is needed
    86 if [[ $1 == "--force" ]]; then
     100if [[ "$FORCE" ]]; then
    87101  fusermount -u -z ${MOUNT}/${BUCKET}
    88102  killall -9 mount.s3ql
    89103  # file system check with force
    90   fsck.s3ql --batch --force ${SERVER}/${BUCKET}
     104  fsck.s3ql --batch --force --backend-options="dumb-copy" ${SERVER}/${BUCKET}
    91105else
    92106  # unmount
    93107  umount.s3ql ${MOUNT}/${BUCKET}
    94108  # check the file system
    95   fsck.s3ql --batch ${SERVER}/${BUCKET}
     109  fsck.s3ql --batch --backend-options="dumb-copy" ${SERVER}/${BUCKET}
    96110fi
    97111