Last active
October 28, 2020 19:54
-
-
Save lukaszlach/55e8e12b5c2732ef4205b8f110aace52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat <<'banner' | |
____ ____ ____ ____ | |
/ _ \/ __\/ _\/ _ \ | |
| / \|| \/|| / | / \| | |
| \_/|| /| \_ | |-|| | |
\____/\_/\_\\____/\_/ \| | |
Docker workshop | |
Łukasz Lach <[email protected]> | |
https://lach.dev/orca | |
banner | |
set -e | |
INPUT_USERNAME="$1" | |
if [[ "$INPUT_USERNAME" == "root" ]]; then | |
echo "Error: This script cannot be run as root" | |
exit 1 | |
fi | |
if [[ -z "$INPUT_USERNAME" ]]; then | |
echo "Enter your username (if your are John Doe that will be jdoe)" | |
echo -n "Username: " | |
read INPUT_USERNAME | |
else | |
echo "Welcome $INPUT_USERNAME" | |
fi | |
if [ -z "$INPUT_USERNAME" ]; then | |
echo "Error: Username cannot be empty" | |
exit 1 | |
fi | |
VPS_ID=$(curl -sSfL -H "Unique-Id: $INPUT_USERNAME" d.cmd.cat:30080/register) | |
echo "Your VPS ID is $VPS_ID" | |
echo "Connect to vps${VPS_ID}.cmd.cat on port 6667" | |
echo | |
cat <<code | |
ssh -p 6667 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null d@vps${VPS_ID}.cmd.cat | |
code | |
echo | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment