mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-05-19 19:27:55 -05:00
- Update all of the scripts to use Bash instead of sh so I can use arrays and other bashisms - Create a complete Bash option parsing framework to replace function-lib.sh - Rewrite all of the scripts to use this framework - General script user-friendliness improvements, including loading existing environment variables by default instead of always requiring them to be specified
34 lines
1.3 KiB
Bash
Executable File
34 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# shellcheck source=./framework.sh
|
|
source "$(dirname "$(realpath "$0")")/framework.sh"
|
|
parse_arguments "$@"
|
|
|
|
create_server_script=$(cat "$git_base_dir/scripts/run-in-container/update-account-servers-database.js")
|
|
|
|
if [[ ! -f "$git_base_dir/environment/server.local.env" ]]; then
|
|
print_error "Missing environment file server.local.env. Did you run setup-environment.sh?"
|
|
exit 1
|
|
fi
|
|
source "$git_base_dir/environment/server.local.env"
|
|
|
|
necessary_environment_files=("friends" "miiverse-api" "wiiu-chat" "super-mario-maker")
|
|
for environment in "${necessary_environment_files[@]}"; do
|
|
if [[ ! -f "$git_base_dir/environment/$environment.local.env" ]]; then
|
|
print_error "Missing environment file $environment.local.env. Did you run setup-environment.sh?"
|
|
exit 1
|
|
fi
|
|
source "$git_base_dir/environment/$environment.env"
|
|
source "$git_base_dir/environment/$environment.local.env"
|
|
done
|
|
|
|
docker compose up -d account
|
|
|
|
docker compose exec -e SERVER_IP="$SERVER_IP" \
|
|
-e FRIENDS_PORT="$PN_FRIENDS_AUTHENTICATION_SERVER_PORT" \
|
|
-e FRIENDS_AES_KEY="$PN_FRIENDS_CONFIG_AES_KEY" \
|
|
-e MIIVERSE_AES_KEY="$PN_MIIVERSE_API_CONFIG_AES_KEY" \
|
|
-e WIIU_CHAT_PORT="$PN_WIIU_CHAT_AUTHENTICATION_SERVER_PORT" \
|
|
-e SMM_PORT="$PN_SMM_AUTHENTICATION_SERVER_PORT" \
|
|
account node -e "$create_server_script"
|