diff options
author | mp7462@student.uni-lj.si <mp7462@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-20 10:28:32 +0000 |
---|---|---|
committer | mp7462@student.uni-lj.si <mp7462@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-20 10:28:32 +0000 |
commit | 535debbf696713e3776e679fc649777372e6b92d (patch) | |
tree | c62ef67c1518a4c46d5e32b57d83054870a0ab90 /kpov_judge/tasks/openvpn_simple_smb | |
parent | c889c2b6de3bbf43b45493b52be48e8813f39c57 (diff) |
Removed install nmap.
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@107 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/openvpn_simple_smb')
-rw-r--r-- | kpov_judge/tasks/openvpn_simple_smb/task.py | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/kpov_judge/tasks/openvpn_simple_smb/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py index 1de4ecc..d6cfae1 100644 --- a/kpov_judge/tasks/openvpn_simple_smb/task.py +++ b/kpov_judge/tasks/openvpn_simple_smb/task.py @@ -22,11 +22,12 @@ Server SimpleArbiterVPN should generate a common secret (*.key), which you shoul and use on VPNClient together with configuration file for OpenVPN connection. After that make sure that VPNClient has enabled access to /home/test/IME_IMENIKA over NFS on it's virtual connection. You will get IME_IMENIKA from SimpleArbiter. Copy files that should be available from AimpleArbiter over SMB to IME_IMENIKA. - """ } computers = { + # SimpleArbiter needs to have the package nmap installed + # http://linux.die.net/man/1/nmap 'SimpleArbiter': { 'disks': [ { 'name': 'SimpleArbiterVPN', @@ -231,33 +232,25 @@ def task(IP_SimpleArbiterVPN, DNS_SimpleArbiterVPN, IP_VPNClient1, DNS_VPNClient ### # Check if both clients are connected to the correct VPN # (check if first 24 bits of IP addr are the same as the IP of the VPN server) - # a.k.a. the YES WE CAN method of checking things - # really, really hoping it has root privileges too ### - ### Install nmap - # TODO: (polz) Don't install nmap here - tell me that you - # need nmap to be present on simpleArbiter and I'll install it. - # Check if root + # User must be root sA.sendline('id -u') sA.prompt() uid = sA.before.split('\n') uid = uid[1].rstrip() - #print uid - # If is isn't root + # If it isn't root if ( uid != "0" ): - print "SimpleArbiter user must be root to continue with this step (installing nmap mostly)" + print "SimpleArbiter user must be root to continue with this step" # If it is, we continue else: - ### Install the nmap package - # Check if nmap is already installed + # Check if nmap is installed sA.sendline('dpkg-query -W nmap') sA.prompt() lines = sA.before.split('\n') line = lines[1] # If it isn't if ( len(line.rstrip()) == 4 ): # returns "nmap\r\n" if package isn't installed - sA.sendline('apt-get install nmap --assume-yes') - # If it is + print "Computer SimpleArbiter must have nmap installed" else: sA.sendline('') #sA.wait() # For some reason this hangs @@ -275,7 +268,7 @@ def task(IP_SimpleArbiterVPN, DNS_SimpleArbiterVPN, IP_VPNClient1, DNS_VPNClient ###### # Ping the VPN server - sC1.sendLine( 'ping -c 3 {0}'.format( DNS_SimpleArbiterVPN ) ) + sC1.sendLine('ping -c 3 {0}'.format( DNS_SimpleArbiterVPN )) sC1.prompt() output = sC1.before results['VPNClient1_ping_VPN_server'] = output @@ -286,7 +279,7 @@ def task(IP_SimpleArbiterVPN, DNS_SimpleArbiterVPN, IP_VPNClient1, DNS_VPNClient ###### # Ping the VPN server - sC2.sendLine( 'ping -c 3 {0}'.format( DNS_SimpleArbiterVPN ) ) + sC2.sendLine('ping -c 3 {0}'.format( DNS_SimpleArbiterVPN )) sC2.prompt() output = sC2.before results['VPNClient2_ping_VPN_server'] = output |