This commit is contained in:
Aryan Singh committed 2026-09-12 19:22:35 -05:00
1 parent ca1073beda
commit 249f0b844b
5 files changed
+58 -1

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
#/usr/bin/env bash
/Users/aryan/Documents/Github/fa26_cs425_.group-mp_.team-01/MP1/scripts/kill_mp.sh all
for i in {1..10}; do
vpn ssh -n -f -o BatchMode=yes "server$i" "cd fa26_cs425_.group-mp_.team-01/MP1 && git pull origin aryan && /Users/aryan/Documents/Github/fa26_cs425_.group-mp_.team-01/MP1/scripts/install_cmd.sh"
done
/Users/aryan/Documents/Github/fa26_cs425_.group-mp_.team-01/MP1/scripts/run_mp.sh all
Regular → Executable
View File
File mode changed.
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
if [[ "$1" == "all" ]]; then
for i in {1..10}; do
echo "Killing server$i..."
vpn ssh -o BatchMode=yes "server$i" "fuser -k -9 5055/tcp"
echo ""
done
else
for i in "$@"; do
echo "Killing server$i..."
vpn ssh -o BatchMode=yes "server$i" "fuser -k -9 5055/tcp"
echo ""
done
fi
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
CMD='cd fa26_cs425_.group-mp_.team-01/MP1 && nohup python3 server.py </dev/null >/dev/null 2>&1 &'
if [[ "$#" -eq 0 ]]; then
echo "Need at least one server number as an argument."
exit 1
fi
if [[ "$1" == "all" ]]; then
TARGETS="1 2 3 4 5 6 7 8 9 10"
else
TARGETS="$@"
fi
echo "Starting servers"
for i in $TARGETS; do
vpn ssh -n -f -o BatchMode=yes "server$i" "$CMD"
done
sleep 2
for i in $TARGETS; do
pid=$(vpn ssh -n -o BatchMode=yes "server$i" "pgrep -o -u \$USER -f '[p]ython3 server.py'")
if [[ -n "$pid" ]]; then
pid_clean=$(echo "$pid" | tr '\n' ' ')
echo "Server$i is running with PID(s): $pid_clean"
else
echo "Server$i is not running."
fi
done
+1 -1
View File
@@ -58,7 +58,7 @@ while True:
result = subprocess.run(command_args, capture_output=True, text=True)
send_message(conn, result.stdout)
send_message(conn, result.stdout + result.stderr)
conn.close()