Fix banner

This commit is contained in:
2021-10-21 11:07:24 -04:00
parent afd9bbdad5
commit d48e7f3f33
2 changed files with 8 additions and 1 deletions

View File

@@ -2,6 +2,10 @@
# Common functions for the lab scripts # Common functions for the lab scripts
# Copyright 2021 Bryan C. Roessler # Copyright 2021 Bryan C. Roessler
# Don't run this script directly
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && exit 0
ask_ok() { ask_ok() {
read -r -p "$* [y/N]" response read -r -p "$* [y/N]" response
response=${response,,} response=${response,,}
@@ -15,6 +19,7 @@ is_root() {
[[ $user != "root" ]] && echo "Script must be run with sudo rights!" && exit 1 [[ $user != "root" ]] && echo "Script must be run with sudo rights!" && exit 1
} }
if ! type -t readarray >/dev/null; then if ! type -t readarray >/dev/null; then
readarray() { readarray() {
local cmd opt t v=MAPFILE local cmd opt t v=MAPFILE

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Install motd scripts # Install motd scripts
# shellcheck source=./functions
[[ -f functions ]] && . functions || exit 1 [[ -f functions ]] && . functions || exit 1
is_root is_root
@@ -15,6 +16,7 @@ if [[ -v DEBUG ]]; then
banner="banner.sh" banner="banner.sh"
else else
banner="$profiledir/banner.sh" banner="$profiledir/banner.sh"
[[ -f ./functions ]] && cp functions "$profiledir"
fi fi
cat <<- 'EOF' > "$banner" cat <<- 'EOF' > "$banner"