Skip to content

Commit 80bb5a6

Browse files
committed
lag script improvements
1 parent 57dc47f commit 80bb5a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

UnityProject/lag.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
PING=${1:300}
3+
PING=${1:-300}
44
PORT=7777
55

66
sudo pfctl -E
@@ -12,9 +12,9 @@ echo "Setting ping to ${PING} on port ${PORT} for tcp and udp traffic..."
1212

1313
# Define `customRule` to pipe traffic to `pipe 1`.
1414
# Note this is the actual port definition, not a textual comment
15-
echo "dummynet in quick proto { tcp udp } from any to any port 7777 pipe 1" | sudo pfctl -a customRule -f -
15+
echo "dummynet in quick proto { tcp udp } from any to any port ${PORT} pipe 1" | sudo pfctl -a customRule -f -
1616

1717
# Define what `pipe 1` should do to traffic
18-
sudo dnctl pipe 1 config delay 300
18+
sudo dnctl pipe 1 config delay ${PING}
1919

2020
echo "Done. Call stoplag.sh to undo these changes."

0 commit comments

Comments
 (0)