Skip to content

Instantly share code, notes, and snippets.

@wallnerryan
Created September 4, 2015 18:28
Show Gist options
  • Save wallnerryan/3137dd68401a249d1396 to your computer and use it in GitHub Desktop.
Save wallnerryan/3137dd68401a249d1396 to your computer and use it in GitHub Desktop.
#!/bin/bash
while [[ $# > 1 ]]
do
key="$1"
case $key in
-o|--os)
OS="$2"
shift
;;
-d|--device)
DEVICE="$2"
shift
;;
-i|--installpath)
INSTALLPATH="$2"
shift
;;
-v|--version)
VERSION="$2"
shift
;;
-n|--packagename)
PACKAGENAME="$2"
shift
;;
-f|--firstmdmip)
FIRSTMDMIP="$2"
shift
;;
-s|--secondmdmip)
SECONDMDMIP="$2"
shift
;;
-c|--clusterinstall)
CLUSTERINSTALL="$2"
shift
;;
*)
# unknown option
;;
esac
shift
done
echo DEVICE = "${DEVICE}"
echo INSTALL PATH = "${INSTALLPATH}"
echo VERSION = "${VERSION}"
echo OS = "${OS}"
echo PACKAGENAME = "${PACKAGENAME}"
echo FIRSTMDMIP = "${FIRSTMDMIP}"
echo SECONDMDMIP = "${SECONDMDMIP}"
echo CLUSTERINSTALL = "${CLUSTERINSTALL}"
#echo "Number files in SEARCH PATH with EXTENSION:" $(ls -1 "${SEARCHPATH}"/*."${EXTENSION}" | wc -l)
truncate -s 100GB ${DEVICE}
yum install numactl libaio wget -y
cd /vagrant
wget -nv ftp://ftp.emc.com/Downloads/ScaleIO/ScaleIO_RHEL6_Download.zip -O ScaleIO_RHEL6_Download.zip
unzip -o ScaleIO_RHEL6_Download.zip -d /vagrant/scaleio/
cd /vagrant/scaleio/ScaleIO_1.32_RHEL7_Download
if [ "${CLUSTERINSTALL}" == "True" ]; then
rpm -Uv ${PACKAGENAME}-tb-${VERSION}.${OS}.x86_64.rpm
rpm -Uv ${PACKAGENAME}-sds-${VERSION}.${OS}.x86_64.rpm
MDM_IP=${FIRSTMDMIP},${SECONDMDMIP} rpm -Uv ${PACKAGENAME}-sdc-${VERSION}.${OS}.x86_64.rpm
fi
if [[ -n $1 ]]; then
echo "Last line of file specified as non-opt/last argument:"
tail -1 $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment