working on a proper installment
authorOliver Maurhart <oliver.maurhart@ait.ac.at>
Wed, 19 Feb 2014 12:59:29 +0100
changeset 753be3d45f6c59
parent 74 a17c4cf8cd38
child 76 6cf4ca255d98
child 78 23551f635ca9
working on a proper installment
OpenSecurity.iss
OpenSecurity/install/initial_vm.bat
     1.1 --- a/OpenSecurity.iss	Wed Feb 19 12:18:03 2014 +0100
     1.2 +++ b/OpenSecurity.iss	Wed Feb 19 12:59:29 2014 +0100
     1.3 @@ -4,6 +4,7 @@
     1.4  
     1.5  [Setup]
     1.6  AppName=OpenSecurity
     1.7 +AppContact=AIT Austrian Institute of Technology
     1.8  AppPublisher=AIT Austrian Institute of Technology
     1.9  AppPublisherURL=http://www.ait.ac.at/
    1.10  AppVersion=0.1
    1.11 @@ -24,5 +25,4 @@
    1.12  Source: "OpenSecurity\python27\*"; DestDir: "{app}\python27"; Flags: recursesubdirs;
    1.13  
    1.14  [Run]
    1.15 -;Filename: "{app}\install\cygwin_rebase.bat"; Description: "Fixing Cygwin64 DLL paths"; WorkingDir: "{app}\install"; StatusMsg: "Relocating Cygwin64..."
    1.16  Filename: "{app}\install\initial_vm.bat"; Description: "Loading initial VM"; WorkingDir: "{app}\install"; StatusMsg: "Setting up initial VM..."; Flags: runasoriginaluser
     2.1 --- a/OpenSecurity/install/initial_vm.bat	Wed Feb 19 12:18:03 2014 +0100
     2.2 +++ b/OpenSecurity/install/initial_vm.bat	Wed Feb 19 12:59:29 2014 +0100
     2.3 @@ -1,7 +1,7 @@
     2.4  @echo off
     2.5  
     2.6  cd "%0%\.."
     2.7 -SET WGET="%0%\..\..\cygwin64\bin\wget.exe"
     2.8 +SET WGET=%0%\..\..\cygwin64\bin\wget.exe
     2.9  SET OS_ADMIN_PORT=8080
    2.10  
    2.11  rem ------------------------------------------------------------
    2.12 @@ -45,31 +45,37 @@
    2.13  :DOWNLOAD_TEMPLATE_VM
    2.14  rem Download the OSec.ova template from the X-Net servers
    2.15  
    2.16 -echo %CD%
    2.17 -PAUSE
    2.18 -
    2.19  IF EXIST OsecVM.ova GOTO COPY_TEMPLATE_VM
    2.20 -echo "download initial OpenSecurity VM"
    2.21 +echo download initial OpenSecurity VM
    2.22  "%WGET%" %OVA_TEMPLATE_URL%
    2.23  IF NOT ERRORLEVEL 0 GOTO OVA_DOWNLOAD_ERROR
    2.24  RENAME OsecVM_latest.ova OsecVM.ova
    2.25 +echo.
    2.26 +echo.
    2.27  
    2.28  :COPY_TEMPLATE_VM
    2.29 -echo "copying template VM into Virtual Box's realm"
    2.30 +echo copying template VM into Virtual Box's realm (this may take a while ... relax ...)
    2.31  %HOMEDRIVE%
    2.32  cd "%VBP%"
    2.33  COPY %0%\..\OSecVM.ova .
    2.34 +echo.
    2.35 +echo.
    2.36  
    2.37  
    2.38  :IMPORT_TEMPLATE_VM
    2.39 +echo importing OpenSecurity VM image ...
    2.40  %VBM% import OsecVM.ova --vsys 0 --vmname SecurityDVM --unit 12 --disk SecurityDVM\SecurityDVM.vmdk
    2.41  IF NOT ERRORLEVEL 0 GOTO VBM_IMPORT_ERROR
    2.42 -echo "turn template into immutable image"
    2.43 +echo.
    2.44 +echo.
    2.45 +echo turning template image immutable
    2.46  %VBM% storageattach SecurityDVM --storagectl SATA --port 0 --medium none
    2.47  %VBM% storageattach SecurityDVM --storagectl SATA --port 0 --device 0 --type hdd --mtype writethrough --medium SecurityDVM\SecurityDVM.vmdk
    2.48  %VBM% storageattach SecurityDVM --storagectl SATA --port 0 --medium none
    2.49  %VBM% storageattach SecurityDVM --storagectl SATA --port 0 --device 0 --type hdd --mtype immutable --medium SecurityDVM\SecurityDVM.vmdk
    2.50 -echo "OpenSecurity VM Image ready."
    2.51 +echo OpenSecurity VM Image ready.
    2.52 +echo.
    2.53 +echo.
    2.54  
    2.55  :UPDATE_TEMPLATE
    2.56  rem we have imported the Template
    2.57 @@ -77,10 +83,11 @@
    2.58  
    2.59  cd %0%\..\..
    2.60  SET PATH=%CD%\python27;%PATH%
    2.61 -CMD /C python27\python bin\opensecurityd.pyw
    2.62 -echo Waiting for OpenSecurity Amdin Daemon to start
    2.63 +START /I python27\python bin\opensecurityd.pyw
    2.64 +echo Waiting for OpenSecurity Admin Daemon to start
    2.65  PAUSE
    2.66  rem trigger update
    2.67 +echo %WGET% http://localhost:%OS_ADMIN_PORT%/update_template
    2.68  %WGET% http://localhost:%OS_ADMIN_PORT%/update_template
    2.69  GOTO END
    2.70