/
ec2gaming
executable file
·43 lines (40 loc) · 1.32 KB
/
ec2gaming
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")/scripts" || exit
COMMANDS=($(find . -name 'ec2gaming-*.sh' | sed 's/.*ec2gaming-//;s/\.sh//'))
if [ -z ${1+x} ]; then
echo "macOS EC2 Gaming with Steam In-Home Streaming"
echo
echo "usage: ec2gaming <command>"
echo
echo "Gaming commands"
echo "start Start gaming - starts instance, VPN and Steam"
echo "stop Stop gaming - stops instance and VPN"
echo
echo "Remote access commands"
echo "rdp Remote desktop connection (no VPN, requires login)"
echo "vnc VNC session (requires VPN, automatic login)"
echo "vpndown Disconnect VPN"
echo "vpnup Connect VPN"
echo
echo "EC2 commands"
echo "instance Get the instance id"
echo "ip Get the IP address of the instance"
echo "price Get the current lowest spot price"
echo "reboot Reboot the instance"
echo "snapshot Snapshot the instance and recreate AMI"
echo "terminate Terminate the instance"
echo
echo "All supported commands"
printf '%s\n' "${COMMANDS[@]}"
echo
echo "For help, go to https://www.reddit.com/r/cloudygamer/"
exit
fi
if [[ ! " ${COMMANDS[@]} " =~ " ${1} " ]]; then
echo "Unknown command '$1'. Supported commands:"
printf '%s\n' "${COMMANDS[@]}"
exit 1
else
./ec2gaming-$1.sh
fi