#!/bin/bash set -e if [[ $# -eq 0 ]] ; then echo "PXConfig Deployer" echo " " echo "./pxconfig.sh -s -v -a " echo " " echo "options:" echo "-s, --service-id=SERVICE_ID specify a service to deploy the dictionary" echo "-v, --version=DIR specify a directory to store output in" echo "-a, --appid=appid specify an appid for the host" exit 0 fi while test $# -gt 0; do case "$1" in -s|-service-id) shift SERVICE_ID=$1 shift ;; -v|-version) shift VERSION=$1 shift ;; -a|-appid) shift APPID=$1 shift ;; *) echo "$1 is not a recognized flag!" exit 0 ;; esac done echo "Creating PX Backend Host..." fastly backend create --version="${VERSION}" --name="PX_BACKEND_${APPID}" --address="sapi-${APPID}.perimeterx.net" --service-id="${SERVICE_ID}" --use-ssl