From 6c9cd8d9be9273ced51eb9607cd5168ac89bc76b Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 22 Jun 2025 22:20:32 -0400 Subject: [PATCH] init install.sh --- install.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..e2939fd --- /dev/null +++ b/install.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# This script creates a config.json file with predefined settings. +# You can extend this script to include other installation requirements, +# such as installing dependencies or setting up your environment. + +create_config_json() { + echo "Creating config.json file..." + + # Define the JSON content directly as a multi-line string + local config_content='{ + "SERVER_WS_URI": "ws://drb-sock.vpn.cusano.net", + "SERVER_API_URL": "https://drb-api.vpn.cusano.net", + "CLIENT_API_URL": "http://localhost:8001", + "nickname": "" + }' + + # Create the data dir + mkdir -p ./data/ + + # Write the content to config.json + # The 'echo' command with a multi-line string is used to write the content. + echo "$config_content" > ./data/config.json + + # Check if the file was successfully created + if [ -f "config.json" ]; then + echo "Successfully created 'config.json'." + echo "Content of config.json:" + cat config.json + else + echo "Error: Failed to create 'config.json'." + exit 1 # Exit with an error code if file creation fails + fi +} + +# Call the function to create the config.json file +create_config_json +echo "--- Config Created ---" + +echo "--- Script finished ---" \ No newline at end of file