Skip to content

Commit

Permalink
Create command_list.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
CPScript authored Oct 23, 2024
1 parent 41d4c49 commit 2ca83ac
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/command_list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

if ! command -v dialog &> /dev/null; then
echo "Installing dialog..."
pkg install dialog -y
fi

SERVER_IP=$(dialog --inputbox "Enter the IP address of the users device:" 8 40 --stdout)
SERVER_PORT=9999

COMMANDS_FILE="commands.txt"

while IFS= read -r command; do
echo "Sending command: $command"
echo "$command" | nc "$SERVER_IP" "$SERVER_PORT"

response=$(nc -w 2 "$SERVER_IP" "$SERVER_PORT")
echo "Response: $response"
done < "$COMMANDS_FILE"

0 comments on commit 2ca83ac

Please # to comment.