File: command.sh

package info (click to toggle)
galera-4 26.4.25-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,968 kB
  • sloc: cpp: 133,534; ansic: 12,171; sh: 1,446; tcl: 51; makefile: 19
file content (33 lines) | stat: -rwxr-xr-x 767 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash -eu

help()
{
    echo "Usage: $0 <command> [args]"
    echo "Cluster commands: install, remove, start, stop, check"
    echo "Node    commands: start_node, stop_node, restart_node, check_node,"
    echo "                  kill_node"
    echo "Command help: $0 <command> help"
}

if [ $# -eq 0 ]; then help >&2; exit 1; fi

declare -r DIST_BASE=$(cd $(dirname $0)/..; pwd -P)
declare -r DIST_SCRIPTS="$DIST_BASE/scripts"

# later create config.sh to read config from command line options

declare -r TEST_BASE=${TEST_BASE:-"$DIST_BASE"}

. "$TEST_BASE/conf/main.conf"

. $DIST_SCRIPTS/jobs.sh
. $DIST_SCRIPTS/install.sh
. $DIST_SCRIPTS/remove.sh
. $DIST_SCRIPTS/action.sh
. $DIST_SCRIPTS/kill.sh
. $DIST_SCRIPTS/signal.sh

command=$1
shift

$command "$@"