added stackscript viewer

This commit is contained in:
finn committed 2026-09-27 17:12:21 -07:00
1 parent efa9fee992
commit 09bed31f06
2 files changed
+28 -1

No files matched your search

+1 -1
View File
@@ -160,7 +160,7 @@ if [[ "$SCRIPT_ACTION" == "d" && -n "$LINODE_LABEL" ]]; then
# Shut the Linode down cleanly before deleting it, so systemd stops the # Shut the Linode down cleanly before deleting it, so systemd stops the
# Docker container and the Valheim server gets the chance to save the world # Docker container and the Valheim server gets the chance to save the world
# rather than being cut off mid-write. # rather than being cut off mid-write.
echo "Soft Shutting down ID:$INSTANCE_ID..." echo "Soft Shutting down ID:$INSTANCE_ID... Blocking 30s for docker..."
curl -s -H "Authorization: Bearer $LINODE_API_KEY" \ curl -s -H "Authorization: Bearer $LINODE_API_KEY" \
-X POST https://api.linode.com/v4/linode/instances/$INSTANCE_ID/shutdown | jq . -X POST https://api.linode.com/v4/linode/instances/$INSTANCE_ID/shutdown | jq .
Executable
+27
View File
@@ -0,0 +1,27 @@
#!/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