Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions plugin/plugins/dynamix.unraid.net.plg
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,7 @@ exit 0
<![CDATA[
SCRIPTS_DIR="/usr/local/share/dynamix.unraid.net/install/scripts"
# Log file for debugging
LOGFILE="/var/log/unraid-api/dynamix-unraid-install.log"
mkdir -p "$(dirname "$LOGFILE")"
mkdir -p "/var/log/unraid-api"

echo "Starting Unraid Connect installation..."

Expand All @@ -344,26 +343,26 @@ CFG_NEW=/boot/config/plugins/dynamix.my.servers
# Setup the API (but don't start it yet)
if [ -x "$SCRIPTS_DIR/setup_api.sh" ]; then
echo "Setting up Unraid API..."
echo "Running setup_api.sh" >> "$LOGFILE"
# Capture output and add to log file
setup_output=$("$SCRIPTS_DIR/setup_api.sh")
echo "$setup_output" >> "$LOGFILE"
echo "Running setup_api.sh"
# Run and show output to user
"$SCRIPTS_DIR/setup_api.sh"
else
echo "ERROR: setup_api.sh not found or not executable" >> "$LOGFILE"
echo "ERROR: setup_api.sh not found or not executable"
echo "ERROR: setup_api.sh not found or not executable"
fi

# Run post-installation verification
if [ -x "$SCRIPTS_DIR/verify_install.sh" ]; then
echo "Running post-installation verification..."
echo "Running verify_install.sh" >> "$LOGFILE"
# Capture output and add to log file
verify_output=$("$SCRIPTS_DIR/verify_install.sh")
echo "$verify_output" >> "$LOGFILE"
echo "Running verify_install.sh"
# Run and show output to user
"$SCRIPTS_DIR/verify_install.sh"
else
echo "ERROR: verify_install.sh not found or not executable" >> "$LOGFILE"
echo "ERROR: verify_install.sh not found or not executable"
echo "ERROR: verify_install.sh not found or not executable"
fi

echo "Installation completed at $(date)" >> "$LOGFILE"
echo "Installation completed at $(date)"
]]>
</INLINE>
</FILE>
Expand All @@ -379,6 +378,18 @@ echo "Installation completed at $(date)" >> "$LOGFILE"
/etc/rc.d/rc.unraid-api cleanup-dependencies

echo "Starting Unraid API service"
echo "DEBUG: Checking PATH: $PATH"
echo "DEBUG: Checking if unraid-api files exist:"
ls -la /usr/local/unraid-api/dist/
echo "DEBUG: Checking symlink:"
ls -la /usr/local/bin/unraid-api
echo "DEBUG: Checking Node.js version:"
node --version
echo "DEBUG: Checking if cli.js is executable:"
ls -la /usr/local/unraid-api/dist/cli.js
echo "DEBUG: Attempting to run unraid-api directly:"
/usr/local/unraid-api/dist/cli.js version || echo "Direct execution failed"

echo "If no additional messages appear within 30 seconds, it is safe to refresh the page."
/etc/rc.d/rc.unraid-api plugins add unraid-api-plugin-connect -b --no-restart
/etc/rc.d/rc.unraid-api start
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/sh
#!/bin/bash
# Unraid API Installation Verification Script
# Checks that critical files are installed correctly

# Exit on errors
set -e

echo "Performing comprehensive installation verification..."

# Define critical files to check (POSIX-compliant, no arrays)
Expand Down Expand Up @@ -171,7 +168,7 @@ if [ $TOTAL_ERRORS -eq 0 ]; then
else
printf 'Found %d total errors.\n' "$TOTAL_ERRORS"
echo "Installation verification completed with issues."
echo "See log file for details: /var/log/unraid-api/dynamix-unraid-install.log"
echo "Please review the errors above and contact support if needed."
# We don't exit with error as this is just a verification script
exit 0
fi