20 lines
678 B
Bash
Executable File
20 lines
678 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Get IP address
|
|
ip_addr=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | head -n 1)
|
|
|
|
if [ -z "$ip_addr" ]; then
|
|
echo "Could not determine IP address"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Starting HTTP server..."
|
|
echo "Your IP address is: $ip_addr"
|
|
echo "Server will be available at: http://$ip_addr:8080/termuxinstall.sh"
|
|
echo ""
|
|
echo "To download and run the script, use:"
|
|
echo "curl -s http://$ip_addr:8080/termuxinstall.sh > /install.sh && bash /install.sh"
|
|
|
|
# Change to the tools directory and start the server (dlx lets you start without downloading)
|
|
cd "$(dirname "$0")" && pnpm dlx http-server . -p 8080
|