Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrote this for a friend to set up the routes, sharing in case anyone finds it useful #90

Open
Kreyren opened this issue Oct 22, 2023 · 1 comment

Comments

@Kreyren
Copy link

Kreyren commented Oct 22, 2023

#!/usr/bin/env sh
# shellcheck shell=sh # POSIX

# Script that does things from https://github.com/Soreepeong/XivMitmLatencyMitigator

set -e # Exit on false return

command -v einfo >/dev/null || einfo() { printf "INFO: %s\n" "$1" ;}
command -v ewarn >/dev/null || ewarn() { printf "WARN: %s\n" "$1" ;}
command -v die >/dev/null || die() { printf "FATAL: %s\n" "$2"; exit 1 ;}

ewarn "Script not sanitized, do not re-run"

[ "$(id -u)" = 0 ] || die 3 "Requires running as root, use sudo?"

read -p "Enter VM IP: " vmIP

case "$(uname -s)" in
				"Linux")
								${ROUTE:-"route"} -n add -net 124.150.157.0/24 "$vmIP"
								${ROUTE:-"route"} -n add -net 153.254.80.0/24 "$vmIP"
								${ROUTE:-"route"} -n add -net 202.67.52.0/24 "$vmIP"
								${ROUTE:-"route"} -n add -net 204.2.29.0/24 "$vmIP"
								${ROUTE:-"route"} -n add -net 80.239.145.0/24 "$vmIP"
				;;
				"Windows")
								command -v ${ROUTE:-"route"} >/dev/null
								${ROUTE:-"route"} add 124.150.157.0 mask 255.255.255.0 "$vmIP"
								${ROUTE:-"route"} add 153.254.80.0 mask 255.255.255.0 "$vmIP"
								${ROUTE:-"route"} add 202.67.52.0 mask 255.255.255.0 "$vmIP"
								${ROUTE:-"route"} add 204.2.29.0 mask 255.255.255.0 "$vmIP"
								${ROUTE:-"route"} add 80.239.145.0 mask 255.255.255.0 "$vmIP"
				;;
				*) die 1 "Operating system '$(uanme -s)' is not implemented"
esac
@bankjaneo
Copy link

The very last line 'uanme -s' -> 'uname -s'

Cheers!✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants