#!/bin/bash # For my use, debian for the little one, ubuntu for the big ones # From .env, following values: # LINODE_API_KEY (used for all Linode API calls below, via curl) # WHICH_DOMAIN # ROOT_PASS source .env # All Linode API requests use the API key sourced from .env above: # curl -H "Authorization: Bearer $LINODE_API_KEY" https://api.linode.com/v4/... #ROOT_PASS=$(for w in {1..3}; do echo -n $(cat /usr/share/dict/words | grep -v "'" | sed -n $(echo "$(cat /usr/share/dict/words | grep -v "'" | wc -l) * $RANDOM / 32768 + 1" | bc)p); done) #ROOT_PASS="StartRootPass5678" SCRIPT_ACTION=$1 LINODE_LABEL=$2 LOGFILE="./linodes.log" # Pre-existing Valheim volume, attached to every Linode at creation time. # The filesystem (mkfs.ext4) was already created; see voldirections.txt. VOLUME_ID="18073448" VOLUME_NAME="ValVol202609" VOLUME_DEVICE="/dev/disk/by-id/scsi-0Linode_Volume_$VOLUME_NAME" VOLUME_MOUNT="/mnt/$VOLUME_NAME" # Cloud Firewall applied to every Linode at creation time. It must allow the # Valheim ports (2456-2457/udp) and, if you still need SSH, port 22. FIREWALL_ID="165767433" # StackScript that mounts the volume on first boot (see stackscript.md). # Enter the numeric StackScript ID manually after creating it in the Linode UI. #STACKSCRIPT_ID="2225110" # Normal: #STACKSCRIPT_ID="2225140" # More resources (1.5): STACKSCRIPT_ID="2225166" if [[ "$SCRIPT_ACTION" == "" || "$SCRIPT_ACTION" == "--help" || "$SCRIPT_ACTION" == "-?" ]]; then echo "Linode helper script: create-linode.sh