diff options
| author | iceyrazor <iceyrazor@mailfence.com> | 2026-06-10 00:48:19 -0500 |
|---|---|---|
| committer | iceyrazor <iceyrazor@mailfence.com> | 2026-06-10 00:48:19 -0500 |
| commit | 2097b0ebfdd07ae7a8295c26703d8d88ee7a5f8f (patch) | |
| tree | 97edcae29f2817f045e0fda462609679935a6fb1 /env/.local/bin/scripts/autoport_mc.sh | |
| parent | 09156e6cea71093079af580acdd6d4a8594e14b9 (diff) | |
Squashed commit of the following:
made all scripts mostly posix
moved from gajim to dino
Diffstat (limited to 'env/.local/bin/scripts/autoport_mc.sh')
| -rwxr-xr-x | env/.local/bin/scripts/autoport_mc.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/env/.local/bin/scripts/autoport_mc.sh b/env/.local/bin/scripts/autoport_mc.sh index 5cad216..370ff14 100755 --- a/env/.local/bin/scripts/autoport_mc.sh +++ b/env/.local/bin/scripts/autoport_mc.sh @@ -2,12 +2,12 @@ # this finds the log file from a picked instance using rofi. then fords traffic thorugh 25565 if [ -z "$LOG_FILE" ]; then - choice="$HOME/stuff/minecraft/polymc/instances/$(ls ~/stuff/minecraft/polymc/instances | rofi -dmenu -p "Instance")" + choice="$HOME/stuff/minecraft/polymc/instances/$(find ~/stuff/minecraft/polymc/instances -maxdepth 1 -exec basename {} \; | rofi -dmenu -p "Instance")" LOG_FILE="$(find "$choice" -mindepth 1 -maxdepth 1 -type d | grep "minecraft$")/logs/latest.log" fi -setport="$(cat "$LOG_FILE" | grep "Started on" | sed 's/.*Started on //' | tail -n 1)" -echo $setport +setport="$(grep "Started on" "$LOG_FILE" | sed 's/.*Started on //' | tail -n 1)" +echo "$setport" if [ "$setport" ]; then - doas socat TCP6-LISTEN:25565,fork TCP4:127.0.0.1:$setport + doas socat -v TCP6-LISTEN:25565,fork TCP4:127.0.0.1:"$setport" fi |
