64 lines
1.8 KiB
Bash
Executable File
64 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Install dependencies script for Runner
|
|
# This script is for Ubuntu/Debian systems
|
|
|
|
echo "Installing dependencies for Runner - Dropshell Command Execution Library"
|
|
echo "======================================================================"
|
|
echo
|
|
|
|
# Check if running as root or with sudo
|
|
if [ "$EUID" -ne 0 ]; then
|
|
echo "Please run this script with sudo:"
|
|
echo " sudo $0"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Updating package lists..."
|
|
apt-get update
|
|
|
|
echo "Installing required packages:"
|
|
echo " - build-essential (C++ compiler and build tools)"
|
|
echo " - cmake (build system)"
|
|
echo " - libssh-dev (SSH client library)"
|
|
echo " - jq (JSON parsing for helper scripts)"
|
|
echo
|
|
|
|
apt-get install -y build-essential cmake libssh-dev jq
|
|
|
|
# Check if installation was successful
|
|
if [ $? -eq 0 ]; then
|
|
echo
|
|
echo "Dependencies installed successfully!"
|
|
echo
|
|
echo "You can now build the project with:"
|
|
echo " ./build.sh"
|
|
echo
|
|
else
|
|
echo
|
|
echo "Error: Failed to install dependencies."
|
|
echo "Please check the error messages above."
|
|
exit 1
|
|
fi
|
|
|
|
# Verify libssh installation
|
|
if [ -f "/usr/include/libssh/libssh.h" ]; then
|
|
echo "Verified: libssh development headers are installed."
|
|
|
|
# Find libssh shared library
|
|
LIB=$(find /usr/lib -name "libssh.so*" | head -1)
|
|
if [ -n "$LIB" ]; then
|
|
echo "Verified: libssh shared library is installed at $LIB"
|
|
else
|
|
echo "Warning: Could not find libssh shared library."
|
|
fi
|
|
|
|
echo
|
|
echo "You're all set! Build the project with ./build.sh"
|
|
else
|
|
echo "Warning: Could not verify libssh installation."
|
|
echo "The package might have been installed in a non-standard location."
|
|
echo "You may need to manually specify the location when building:"
|
|
echo
|
|
echo " cmake -DLIBSSH_LIBRARY=/path/to/libssh.so -DLIBSSH_INCLUDE_DIR=/path/to/include .."
|
|
fi |