#!/bin/bash # # Copyright (C) 2022-present ScyllaDB # # # SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0 # set -e trap 'echo "error $? in $0 line $LINENO"' ERR if [ -z "$BASH_VERSION" ]; then echo "Unsupported shell, please run this script on bash." exit 1 fi print_usage() { cat < "$root/a/b/c" # # The second component is "$prefix". It is used by non-root install to place files into # a directory of the user's choice (typically somewhere under their home directory). In theory # all files should be always under "$prefix", but in practice /etc files are not under "$prefix" # for standard installs (we use /etc not /usr/etc) and are under "$prefix" for non-root installs. # Another exception is files that go under /opt/scylladb in a standard install go under "$prefix" # for a non-root install. # # The last component is the rest of the file name, which doesn't matter for this script and # isn't changed by it. root=/ nonroot=false while [ $# -gt 0 ]; do case "$1" in "--root") root="$(realpath "$2")" shift 2 ;; "--prefix") prefix="$2" shift 2 ;; "--nonroot") nonroot=true shift 1 ;; "--help") shift 1 print_usage ;; *) print_usage ;; esac done # change directory to the package's root directory cd "$(dirname "$0")" if [ -z "$prefix" ]; then if $nonroot; then prefix=~/scylladb else prefix=/opt/scylladb fi fi rprefix=$(realpath -m "$root/$prefix") install -d -m755 "$rprefix"/libexec/.debug cp -r ./libexec/.debug/* "$rprefix"/libexec/.debug install -d -m755 "$rprefix"/node_exporter/.debug cp -r ./node_exporter/.debug/* "$rprefix"/node_exporter/.debug