Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow script to run from any directory #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,22 @@ if $ERR; then
exit 1
fi

if [ -d "$NAME" ]; then
echo "Directory - ${NAME} already exists, can't recreate it."
if [ -d "/vmfs/volumes/datastore1/$NAME" ]; then
echo "Directory - /vmfs/volumes/datastore1/${NAME} already exists, can't recreate it."
exit
fi

#Creating the folder for the Virtual Machine
mkdir ${NAME}
mkdir /vmfs/volumes/datastore1/${NAME}

#Creating the actual Virtual Disk file (the HDD) with vmkfstools
vmkfstools -c "${SIZE}"G -a lsilogic $NAME/$NAME.vmdk
vmkfstools -c "${SIZE}"G -a lsilogic /vmfs/volumes/datastore1/$NAME/$NAME.vmdk

#Creating the config file
touch $NAME/$NAME.vmx
touch /vmfs/volumes/datastore1/$NAME/$NAME.vmx

#writing information into the configuration file
cat << EOF > $NAME/$NAME.vmx
cat << EOF > /vmfs/volumes/datastore1/$NAME/$NAME.vmx

config.version = "8"
virtualHW.version = "7"
Expand Down