diff --git a/logclient/install.sh b/logclient/install.sh index e0e0b3c..62efcce 100755 --- a/logclient/install.sh +++ b/logclient/install.sh @@ -16,7 +16,8 @@ bash ./stop.sh 2>/dev/null || true # Generate configuration echo "Generating configuration..." -export HOSTNAME=$(hostname) +HOSTNAME=$(hostname) +export HOSTNAME bash "$SCRIPT_DIR/scripts/generate-config.sh" || _die "Failed to generate configuration" # Start the client diff --git a/simple-logs/config/.template_info.env b/simple-logs/config/.template_info.env new file mode 100644 index 0000000..51a9694 --- /dev/null +++ b/simple-logs/config/.template_info.env @@ -0,0 +1,7 @@ +# Template identifier - MUST match the directory name +TEMPLATE=simple-logs + +# Requirements +REQUIRES_HOST_ROOT=false +REQUIRES_DOCKER=true +REQUIRES_DOCKER_ROOT=false diff --git a/squashdisplay/install.sh b/squashdisplay/install.sh index ef0abeb..243258a 100755 --- a/squashdisplay/install.sh +++ b/squashdisplay/install.sh @@ -40,7 +40,7 @@ if [ -z "$SYSTEM_TYPE" ]; then echo " Hardware: Mac Mini" fi fi - elif [ "$ID" = "raspbian" ] || [ "$ID" = "debian" ] && [ "$(uname -m)" = "aarch64" -o "$(uname -m)" = "armv7l" ]; then + elif { [ "$ID" = "raspbian" ] || [ "$ID" = "debian" ]; } && { [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "armv7l" ]; }; then SYSTEM_TYPE="rpi" echo " Detected: Raspberry Pi OS" fi diff --git a/squashdisplay/setup.sh b/squashdisplay/setup.sh index 65f3472..1ef2588 100755 --- a/squashdisplay/setup.sh +++ b/squashdisplay/setup.sh @@ -181,7 +181,7 @@ fi BASHRC if [ "${ENABLE_WATCHDOG}" = "true" ]; then - echo '~/watchdog.sh &' >> /tmp/bashrc_append + echo '$HOME/watchdog.sh &' >> /tmp/bashrc_append fi host_exec sh -c "cat /tmp/bashrc_append >> /home/${KIOSK_USER}/.bashrc" diff --git a/squashthumbnailmaker/install.sh b/squashthumbnailmaker/install.sh index a6ac7f0..72b3760 100755 --- a/squashthumbnailmaker/install.sh +++ b/squashthumbnailmaker/install.sh @@ -11,7 +11,7 @@ _check_docker_installed || _die "Docker test failed" echo "Building squashthumbnailmaker Docker image..." # Build the Docker image locally -cd "$SCRIPT_DIR" +cd "$SCRIPT_DIR" || _die "Failed to change to script directory" docker build -t "${CONTAINER_NAME}_image:latest" . || _die "Failed to build Docker image" echo "Installation of ${CONTAINER_NAME} complete" diff --git a/tailscale/start.sh b/tailscale/start.sh index fe23bb5..5683240 100755 --- a/tailscale/start.sh +++ b/tailscale/start.sh @@ -11,6 +11,7 @@ fi echo "Starting Tailscale container..." # Determine if we should use userspace networking +# shellcheck disable=SC2034 # Reserved for future network mode options NETWORK_MODE="" CAP_ADD="" DEVICE_MOUNT="" diff --git a/wikijs/backup.sh b/wikijs/backup.sh index 0264c1e..ec62bea 100755 --- a/wikijs/backup.sh +++ b/wikijs/backup.sh @@ -8,7 +8,7 @@ _check_required_env_vars "CONTAINER_NAME" "DATA_PATH" "DB_NAME" "DB_USER" # Export variables for docker compose export CONTAINER_NAME DATA_PATH HTTP_PORT PUID PGID TZ IMAGE_TAG DB_NAME DB_USER DB_PASS -cd "$SCRIPT_DIR" +cd "$SCRIPT_DIR" || _die "Failed to change to script directory" # Dump PostgreSQL database before backup echo "Dumping PostgreSQL database..." diff --git a/wikijs/destroy.sh b/wikijs/destroy.sh index 87ac364..17b8c88 100755 --- a/wikijs/destroy.sh +++ b/wikijs/destroy.sh @@ -9,7 +9,7 @@ export CONTAINER_NAME DATA_PATH HTTP_PORT PUID PGID TZ IMAGE_TAG DB_NAME DB_USER echo "WARNING: This will PERMANENTLY DELETE all data for ${CONTAINER_NAME}" echo "This includes all wiki pages, users, database, and configuration!" -cd "$SCRIPT_DIR" +cd "$SCRIPT_DIR" || _die "Failed to change to script directory" # Stop and remove containers docker compose down -v 2>/dev/null || true diff --git a/wikijs/install.sh b/wikijs/install.sh index cf60b36..b1932e5 100755 --- a/wikijs/install.sh +++ b/wikijs/install.sh @@ -27,7 +27,7 @@ EOF # Export variables for docker compose export CONTAINER_NAME DATA_PATH HTTP_PORT PUID PGID TZ IMAGE_TAG DB_NAME DB_USER DB_PASS -cd "$SCRIPT_DIR" +cd "$SCRIPT_DIR" || _die "Failed to change to script directory" # Pull images docker compose pull || _die "Failed to pull images" diff --git a/wikijs/logs.sh b/wikijs/logs.sh index 22c7ae1..34c98b9 100755 --- a/wikijs/logs.sh +++ b/wikijs/logs.sh @@ -6,7 +6,7 @@ _check_required_env_vars "CONTAINER_NAME" # Export variables for docker compose export CONTAINER_NAME DATA_PATH HTTP_PORT PUID PGID TZ IMAGE_TAG DB_NAME DB_USER DB_PASS -cd "$SCRIPT_DIR" +cd "$SCRIPT_DIR" || _die "Failed to change to script directory" echo "Container ${CONTAINER_NAME} logs:" _grey_start diff --git a/wikijs/restore.sh b/wikijs/restore.sh index a34f01e..01a487b 100755 --- a/wikijs/restore.sh +++ b/wikijs/restore.sh @@ -8,7 +8,7 @@ _check_required_env_vars "CONTAINER_NAME" "DATA_PATH" "DB_NAME" "DB_USER" # Export variables for docker compose export CONTAINER_NAME DATA_PATH HTTP_PORT PUID PGID TZ IMAGE_TAG DB_NAME DB_USER DB_PASS -cd "$SCRIPT_DIR" +cd "$SCRIPT_DIR" || _die "Failed to change to script directory" # Stop and remove containers before restore docker compose down diff --git a/wikijs/start.sh b/wikijs/start.sh index 1d5a316..6f4a465 100755 --- a/wikijs/start.sh +++ b/wikijs/start.sh @@ -6,7 +6,7 @@ _check_required_env_vars "CONTAINER_NAME" "DATA_PATH" # Export variables for docker compose export CONTAINER_NAME DATA_PATH HTTP_PORT PUID PGID TZ IMAGE_TAG DB_NAME DB_USER DB_PASS -cd "$SCRIPT_DIR" +cd "$SCRIPT_DIR" || _die "Failed to change to script directory" docker compose up -d || _die "Failed to start containers" echo "Container ${CONTAINER_NAME} started" diff --git a/wikijs/stop.sh b/wikijs/stop.sh index 91bb966..99bf768 100755 --- a/wikijs/stop.sh +++ b/wikijs/stop.sh @@ -6,7 +6,7 @@ _check_required_env_vars "CONTAINER_NAME" # Export variables for docker compose export CONTAINER_NAME DATA_PATH HTTP_PORT PUID PGID TZ IMAGE_TAG DB_NAME DB_USER DB_PASS -cd "$SCRIPT_DIR" +cd "$SCRIPT_DIR" || _die "Failed to change to script directory" docker compose stop || _die "Failed to stop containers" echo "Container ${CONTAINER_NAME} stopped" diff --git a/wikijs/uninstall.sh b/wikijs/uninstall.sh index 550080f..df38f21 100755 --- a/wikijs/uninstall.sh +++ b/wikijs/uninstall.sh @@ -6,7 +6,7 @@ _check_required_env_vars "CONTAINER_NAME" # Export variables for docker compose export CONTAINER_NAME DATA_PATH HTTP_PORT PUID PGID TZ IMAGE_TAG DB_NAME DB_USER DB_PASS -cd "$SCRIPT_DIR" +cd "$SCRIPT_DIR" || _die "Failed to change to script directory" # Stop and remove containers (but preserve volumes/data) docker compose down || _die "Failed to stop containers"