#!/bin/bash function usage() { actions=$(find "$srcdir/actions" -maxdepth 1 -name '*.sh' | xargs basename | cut -d. -f1) cat < Run $(basename "$0") --help for more details. Available actions: $actions EOF exit 1 } if [ -L "$0" ]; then export srcdir="$(dirname "$(readlink -f "$0")")" else export srcdir="$(cd "$(dirname "$0")" && pwd)" fi source "$srcdir/helpers/common.sh" action=$1 shift case "$action" in install) source "$srcdir/actions/install.sh";; *) usage;; esac