From 11a6eafe6010386b632ee284d5c6560985e43e63 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 23 Jan 2021 19:21:31 -0700 Subject: [PATCH] prices, ipxe --- eqx-create-device | 8 +++++--- eqx-market-spot-prices | 13 +++++++++++++ ipxe-install-debian-10 | 6 ++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100755 eqx-market-spot-prices create mode 100644 ipxe-install-debian-10 diff --git a/eqx-create-device b/eqx-create-device index 8af427a..593b91b 100755 --- a/eqx-create-device +++ b/eqx-create-device @@ -16,13 +16,16 @@ #set -x # Set static variables here -EQXSPOTMAX="0.18" EQXFACILITY="da11" EQXOS="debian_10" EQXPLAN="c3.small.x86" EQXTAGS="cluster" +EQXSPOTOVER=".02" # Probably leave these variables alone +# Set max price at current spot plus EQXSPOTOVER from above +EQXSPOT="`eqx-market-spot-prices`" +EQXSPOTMAX=`echo "$EQXSPOT + $EQXSPOTOVER" | bc -l | xargs printf "%1.2f"` EQXPROJECT="$1" if [[ $1 == "" ]] then EQXPROJECT=`eqx-create-project` @@ -32,6 +35,7 @@ fi EQXHOSTNAME=`dd bs=12 count=1 if=/dev/random 2>/dev/null | base64 | tr [:upper:] [:lower:] | tr -dc [:alpha:]` EQXPROJECTID=`eqx-get-project-uuid $EQXPROJECT` +echo "Spot: $EQXSPOT" echo "Spot Max: $EQXSPOTMAX" echo "Project: $EQXPROJECT" echo "ProjectID: $EQXPROJECTID" @@ -41,7 +45,6 @@ echo "Hostname: $EQXHOSTNAME" echo "OS: $EQXOS" echo "Tag: $EQXTAGS" -#cat >> tmpfoo <