diff options
Diffstat (limited to 'create_service.sh')
-rwxr-xr-x | create_service.sh | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/create_service.sh b/create_service.sh index acbdf5f..ee01e7d 100755 --- a/create_service.sh +++ b/create_service.sh @@ -2,18 +2,25 @@ set -e -DNS_ENDPOINT="https://hatecomputers.club/dns" -BIND_FILE="roles/nameservers/templates/db.simponic.xyz.j2" - -SERVICE_TITLE="phoneof simponic." -SERVICE="phoneof" -SERVICE_PORT="6363" -SERVICE_REPO="git.simponic.xyz/simponic/$SERVICE" -SERVICE_ORIGIN="git@git.simponic.xyz:simponic/$SERVICE" -INTERNAL="no" -SERVICE_HOST="ryo" -PACKAGE_PATH="$HOME/git/simponic/$SERVICE" -HATECOMPUTERS_API_KEY="$(pbpaste)" +prompt_with_default() { + local prompt_message="$1" + local default_value="$2" + read -p "$prompt_message [$default_value]: " input + echo "${input:-$default_value}" +} + +DNS_ENDPOINT=$(prompt_with_default "Enter DNS endpoint" "https://hatecomputers.club/dns") +BIND_FILE=$(prompt_with_default "Enter bind file path" "roles/nameservers/templates/db.simponic.xyz.j2") + +SERVICE_TITLE=$(prompt_with_default "Enter service title" "phoneof simponic.") +SERVICE=$(prompt_with_default "Enter service name" "phoneof") +SERVICE_PORT=$(prompt_with_default "Enter service port" "6363") +SERVICE_REPO=$(prompt_with_default "Enter service repository URL" "git.simponic.xyz/simponic/$SERVICE") +SERVICE_ORIGIN=$(prompt_with_default "Enter service origin URL" "git@git.simponic.xyz:simponic/$SERVICE") +INTERNAL=$(prompt_with_default "Is the service internal? (yes/no)" "no") +SERVICE_HOST=$(prompt_with_default "Enter service host" "ryo") +PACKAGE_PATH=$(prompt_with_default "Enter package path" "$HOME/git/simponic/$SERVICE") +HATECOMPUTERS_API_KEY=$(prompt_with_default "Enter hatecomputers API key (paste from clipboard)" "$(pbpaste)") function render_template() { |