#!/bin/bash set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR usage() { cat <<'EOF' usage $0 [hostname|ip|default]... Sets up tftp pxe config. No argument disables for all hosts. EOF exit $1 } cd "${BASH_SOURCE%/*}" # directory of the script host=$(chost faiserver) ssh root@$host bash -s "$@"