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