From 39f74337376e1acab55e3d28dfbb5227d7f5118b Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Sun, 30 Jun 2024 20:35:24 -0400 Subject: [PATCH] Add link to manual in motd --- script-functions | 6 ++++++ script-install-motd | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/script-functions b/script-functions index 179c7bcf..fe1f35d5 100644 --- a/script-functions +++ b/script-functions @@ -5,6 +5,12 @@ # Don't run this script directly [[ "${BASH_SOURCE[0]}" == "${0}" ]] && exit 0 + +### VARS ### +export INSTALL_DIR=/usr/local/bin + + +### FUNCTIONS ### prompt() { read -r -p "Enter $1: " "$1"; } ask_ok() { diff --git a/script-install-motd b/script-install-motd index bb47b65b..64176f62 100755 --- a/script-install-motd +++ b/script-install-motd @@ -9,17 +9,17 @@ parent=${parent%/*} is_root -[[ "$#" -gt 0 ]] && DEBUG=on +DEBUG=0 +[[ "$#" -gt 0 ]] && echo "Debug on" && DEBUG=1 -installdir="/usr/local/bin/" +installdir="/usr/local/bin" -[[ ! -d "$installdir" ]] && mkdir -p "$installdir" +[[ -d "$installdir" ]] || mkdir -p "$installdir" -if [[ -v DEBUG ]]; then +if (( DEBUG )); then script="generate-motd.sh" else script="$installdir/generate-motd.sh" - [[ -f ./functions ]] && cp -f functions "$installdir" fi cat <<- 'EOF' > "$script" @@ -61,6 +61,7 @@ $W Load........: $G$LOAD1$W (1m), $G$LOAD5$W (5m), $G$LOAD15$W (15m) $W Processes...:$W $G$PROCESS_ROOT$W (root), $G$PROCESS_USER$W (user), $G$PROCESS_ALL$W (total) $W CPU.........: $W$PROCESSOR_NAME ($G$PROCESSOR_COUNT$W vCPU) $W Memory......: $G$USED$W used, $G$AVAIL$W avail, $G$TOTAL$W total$W" +$W Manual......: https://docs.google.com/document/d/1K_KwAlv8Zljmy-enwmhT6gMTFutlAFglixvpLGBx0VY" EOF # Disk usage