diff --git a/graylog/install.sh b/graylog/install.sh index a0d8ee8..48e5078 100755 --- a/graylog/install.sh +++ b/graylog/install.sh @@ -1,11 +1,11 @@ #!/bin/bash source "${AGENT_PATH}/common.sh" -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" _check_required_env_vars "CONTAINER_NAME" "GRAYLOG_PASSWORD_SECRET" "GRAYLOG_ROOT_PASSWORD" # Convert plain text password to SHA256 for Graylog -export GRAYLOG_ROOT_PASSWORD_SHA2=$(echo -n "${GRAYLOG_ROOT_PASSWORD}" | sha256sum | cut -d' ' -f1) +GRAYLOG_ROOT_PASSWORD_SHA2=$(echo -n "${GRAYLOG_ROOT_PASSWORD}" | sha256sum | cut -d' ' -f1) +export GRAYLOG_ROOT_PASSWORD_SHA2 # Check Docker _check_docker_installed || _die "Docker test failed" diff --git a/graylog/start.sh b/graylog/start.sh index 736913d..3a96c1b 100755 --- a/graylog/start.sh +++ b/graylog/start.sh @@ -7,7 +7,8 @@ _check_required_env_vars "CONTAINER_NAME" "GRAYLOG_ROOT_PASSWORD" # It is used to start the service on the server. # Convert plain text password to SHA256 for Graylog -export GRAYLOG_ROOT_PASSWORD_SHA2=$(echo -n "${GRAYLOG_ROOT_PASSWORD}" | sha256sum | cut -d' ' -f1) +GRAYLOG_ROOT_PASSWORD_SHA2=$(echo -n "${GRAYLOG_ROOT_PASSWORD}" | sha256sum | cut -d' ' -f1) +export GRAYLOG_ROOT_PASSWORD_SHA2 docker compose -p "${CONTAINER_NAME}" up -d || _die "Failed to start Graylog stack" diff --git a/squashdisplay/install.sh b/squashdisplay/install.sh index 243258a..f5b3dc5 100755 --- a/squashdisplay/install.sh +++ b/squashdisplay/install.sh @@ -49,15 +49,20 @@ fi if [ -z "$SYSTEM_TYPE" ]; then echo " Could not auto-detect system type." - echo " Please select your system:" - echo " 1) Raspberry Pi" - echo " 2) Ubuntu (x86_64/Mac Mini)" - read -p " Enter choice (1 or 2): " choice - case $choice in - 1) SYSTEM_TYPE="rpi" ;; - 2) SYSTEM_TYPE="ubuntu" ;; - *) _die "Invalid choice. Installation cancelled." ;; - esac + # Check if running interactively + if [ -t 0 ]; then + echo " Please select your system:" + echo " 1) Raspberry Pi" + echo " 2) Ubuntu (x86_64/Mac Mini)" + read -p " Enter choice (1 or 2): " choice + case $choice in + 1) SYSTEM_TYPE="rpi" ;; + 2) SYSTEM_TYPE="ubuntu" ;; + *) _die "Invalid choice. Installation cancelled." ;; + esac + else + _die "Could not auto-detect system type. Set SYSTEM_TYPE=rpi or SYSTEM_TYPE=ubuntu in service.env" + fi fi echo ""