github.com/swiftstack/ProxyFS@v0.0.0-20210203235616-4017c267d62f/cookbooks/proxyfs/files/default/usr/bin/disable_s3 (about)

     1  #!/bin/bash
     2  
     3  # Copyright (c) 2015-2021, NVIDIA CORPORATION.
     4  # SPDX-License-Identifier: Apache-2.0
     5  
     6  set -e
     7  
     8  usage() {
     9      echo "Usage: $0 [s3 library name]"
    10      echo "s3 library name options:"
    11      echo "    s3api"
    12      echo "    swift3"
    13      exit 1
    14  }
    15  
    16  if [ $# -gt 0 ]; then
    17      LIBRARY="$1"
    18      LIBRARY=${LIBRARY,,}
    19      if [ "$LIBRARY" != "s3api" ] && [ "$LIBRARY" != "swift3" ]; then
    20          if [ "$LIBRARY" != "-h" ] && [ "$LIBRARY" != "--help" ]; then
    21              echo "Invalid argument '$1'."
    22              echo
    23          fi
    24          usage
    25      fi
    26  else
    27      usage
    28  fi
    29  
    30  PROXYSERVERCONF=/etc/swift/proxy-server.conf
    31  
    32  sed -i "/^pipeline/ s/${LIBRARY} tempauth/tempauth/" $PROXYSERVERCONF
    33  
    34  echo "${LIBRARY} was successfully disabled. Remember to restart Swift or just run:"
    35  echo "    start_and_mount_pfs"