#!/bin/bash # Display the StackScript used to provision the Valheim Linode. # Sourcing create-linode.sh (with no positional parameters) loads STACKSCRIPT_ID # and the .env values it depends on, without running any of its actions. # Drop any arguments passed to this script. "source" inherits the caller's # positional parameters, so leaving them in place could make create-linode.sh # run an action (e.g. create or destroy) instead of just defining variables. set -- # With no action argument create-linode.sh only prints its help text; that is # not relevant here, so discard it. source ./create-linode.sh >/dev/null if [[ -z "$LINODE_API_KEY" ]]; then echo "ERROR: LINODE_API_KEY is not set; check .env." >&2 exit 1 fi if [[ -z "$STACKSCRIPT_ID" ]]; then echo "ERROR: STACKSCRIPT_ID is not set in create-linode.sh." >&2 exit 1 fi curl -s -H "Authorization: Bearer $LINODE_API_KEY" \ https://api.linode.com/v4/linode/stackscripts/$STACKSCRIPT_ID | jq -r .script