hostbasket/start.sh
Mahmoud-Emad 464e253739 feat: Enhance contract management with new features
- Implement comprehensive contract listing with filtering by
  status and type, and search functionality.
- Add contract cloning, sharing, and cancellation features.
- Improve contract details view with enhanced UI and activity
  timeline.
- Implement signer management with add/update/delete and status
  updates, including signature data handling and rejection.
- Introduce contract creation and editing functionalities with
  markdown support.
- Add error handling for contract not found scenarios.
- Implement reminder system for pending signatures with rate
  limiting and status tracking.
- Add API endpoint for retrieving contract statistics.
- Improve logging with more descriptive messages.
- Refactor code for better structure and maintainability.
2025-06-12 13:53:33 +03:00

53 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Default port
PORT=9999
# Parse command line arguments
FORCE=false
while getopts "f" opt; do
case $opt in
f)
FORCE=true
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
# Function to check if port is in use
is_port_in_use() {
lsof -i :$1 &>/dev/null
return $?
}
# Function to kill process on port
kill_process_on_port() {
echo "Killing process on port $1..."
lsof -ti :$1 | xargs kill -9 2>/dev/null
}
# Kill any processes using ports in the 99xx range if force flag is set
if [ "$FORCE" = true ]; then
echo "Force flag set. Killing any processes on port $PORT..."
kill_process_on_port $PORT
else
# Check if port is already in use
if is_port_in_use $PORT; then
echo "Port $PORT is already in use. Use -f flag to force kill and restart."
exit 1
fi
fi
# Change to the directory where the script is located
cd "$(dirname "$0")"
# Navigate to the Actix application directory
cd actix_mvc_app
# Run the application on the specified port
echo "Starting application on port $PORT..."
echo "[Running with PORT=$PORT]"
PORT=$PORT cargo watch -x run