diff options
Diffstat (limited to 's3.in')
-rw-r--r-- | s3.in | 58 |
1 files changed, 29 insertions, 29 deletions
@@ -1,6 +1,6 @@ #! /bin/sh # This file is part of BEAM -# Copyright (C) 2012 Sergey Poznyakoff +# Copyright (C) 2012-2014 Sergey Poznyakoff # # BEAM is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,27 +20,27 @@ set -e set +e if [ "$1" = "--wtf" ]; then - wtf $(basename $0) mount or unmount a backup s3 bucket - exit 0 + wtf $(basename $0) mount or unmount a backup s3 bucket + exit 0 fi test -z "$BEAM_CONFIG" && BEAM_CONFIG=@SYSCONFDIR@/beam.conf if [ ! -r $BEAM_CONFIG ]; then - echo >&2 "$0: configuration file $BEAM_CONFIG is not found or is unreadable" - exit 1 + echo >&2 "$0: configuration file $BEAM_CONFIG is not found or is unreadable" + exit 1 fi . $BEAM_CONFIG . @LIBDIR@/beam/s3.sh if [ -z "$backup_bucket_name" ]; then - echo >&2 "$0: backup_bucket_name is not defined (examine $BEAM_CONFIG)" - exit 1 + echo >&2 "$0: backup_bucket_name is not defined (examine $BEAM_CONFIG)" + exit 1 fi help() { - cat <<EOT + cat <<EOT usage: beam s3 [OPTIONS] or: beam s3 {mount|umount|status} $0 mounts or unmounts a backup s3 bucket, as configured in $BEAM_CONFIG @@ -53,33 +53,33 @@ Valid ITEMs are: $backup_items Report bugs to <@PACKAGE_BUGREPORT@> EOT - exit 0 + exit 0 } while [ $# -ne 0 ] do - case $1 in - -h|--help) help;; - -V|--version) print_version;; - *) break;; - esac + case $1 in + -h|--help) help;; + -V|--version) print_version;; + *) break;; + esac done case $1 in -mount) - s3_mount - echo "$backup_bucket_name mounted under $backup_mp_s3";; -umount|unmount) - s3_unmount --force;; -status) - for id in s3 backer - do - mpoint=$(s3_getmpoint $id) - if [ -n "$mpoint" ]; then - echo "$id is mounted on $mpoint" - fi - done;; + mount) + s3_mount + echo "$backup_bucket_name mounted under $backup_mp_s3";; + umount|unmount) + s3_unmount --force;; + status) + for id in s3 backer + do + mpoint=$(s3_getmpoint $id) + if [ -n "$mpoint" ]; then + echo "$id is mounted on $mpoint" + fi + done;; -*) help - exit 1;; + *) help + exit 1;; esac |