OpenSecurity/bin/download_initial_image.sh
author Oliver Maurhart <oliver.maurhart@ait.ac.at>
Thu, 12 Jun 2014 12:11:32 +0200
changeset 186 e6c5d9ec9f6d
parent 173 0659c6521fdc
child 214 2e2261ce334b
permissions -rwxr-xr-x
new version number for next release
     1 #!/bin/bash
     2 
     3 # ------------------------------------------------------------
     4 # download initial VM for
     5 #
     6 #       OpenSecurity V0.2.7
     7 #
     8 # (C)opyright 2014, AIT Austrian Instiitute of Technology
     9 # ------------------------------------------------------------
    10 
    11 # ------------------------------------------------------------
    12 # code
    13 
    14 
    15 # download the ionitial OsecVM.ova from the X-Net servers
    16 # and place the file in the folder specified by ${1}
    17 
    18 
    19 # ------------------------------
    20 # main ...
    21 #
    22 
    23 # check if we do have elevated rights
    24 # that is "Run as Administrator" invocation
    25 id -G | grep 544 &> /dev/null
    26 if [ "${?}" != 0 ]; then
    27     echo "Insufficient privileges. Is this script executed with 'Run As Administrator'?"
    28     echo "I'll try anyway..."
    29 fi
    30 
    31 TARGET_FOLDER="${1}"
    32 echo "fetching OpenSecurity initial VM at " $(date)
    33 echo "target folder: ${TARGET_FOLDER}"
    34 
    35 # sanity check
    36 mkdir -p "${TARGET_FOLDER}" 
    37 if [ ! -d "${TARGET_FOLDER}" ]; then
    38     echo "failed to access target folder."
    39     exit 1
    40 fi
    41 
    42 # start download
    43 URL="http://service.x-net.at/opensecurity/OsecVM_latest.ova"
    44 wget --progress=dot:mega ${URL} -O "${TARGET_FOLDER}"/OsecVM.ova
    45 
    46