RunUrl Style Bootstrap

by skystackops
16 deployments · 2 still active · last rev. 1 year ago

RunUrl style bootstrap for simplicity loads up an extended bootstrap from the Servana API for the instance in question.

Compatible with: CentOS 5.6
						#!/bin/bash
# StackScript Servana preparation script for Linode
# This script will prepare a server for Servana.
# 
# Copyright 2010, Goldspring Ventures, Ltd.
# http://skystack.com or email us on hello [ at ] servana.io
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# <UDF name="INSTANCE_ID" Label="SERVANA INSTANCE ID"/>
# <UDF name="ALIAS" Label="SERVANA ALIAS"/>
# <UDF name="API_USER" Label="SERVANA USERNAME"/>
# <UDF name="API_TOKEN" Label="SERVANA API TOKEN"/>

if [ ! -e /tmp/bootstrap ];then
 curl -o "/tmp/bootstrap" -u "$API_USER:$API_TOKEN" "https://app.servana.io/$ALIAS/instances/$INSTANCE_ID/bootstrap.sh"
 echo "execute bootstrap"
 chmod +x /tmp/bootstrap
 /tmp/bootstrap
 echo "finished"
fi