#!/bin/sh # The one line for a new Varde Labs box: curl -fsSL https://get.vardelabs.com | sh # Extra arguments go to stage one: curl -fsSL https://get.vardelabs.com | sh -s -- --tag tag:server set -eu # One function called on the last line, so a download cut short runs nothing. load() { say() { echo "get.vardelabs.com: $*" >&2; } [ "$(id -u)" = 0 ] || { say "run this as root"; exit 1; } for tool in bash curl sha256sum mktemp; do command -v "$tool" >/dev/null 2>&1 || { say "this box has no $tool"; exit 1; } done # curl | sh hands this script stdin, so stage one and the session it starts read the terminal. ( : /dev/null || { say "run this from a terminal"; exit 1; } work=$(mktemp -d) trap 'rm -rf "$work"' EXIT curl -fsSL --proto '=https' --tlsv1.2 "https://get.vardelabs.com/stage-one.sh" -o "$work/stage-one.sh" echo "7d06b346e9970da7dfdee86920a7e086d7e54b46b7078d6cb95857bace631009 $work/stage-one.sh" | sha256sum -c --status || { say "stage one does not match its pinned SHA-256, so nothing ran"; exit 1; } bash "$work/stage-one.sh" --anchor 87608b0e2412ad63469e100deed7ccc747cab436 --repo https://github.com/vardelabs/varde-agent-deployment.git "$@"