Virtual Box 2.0.4

I have taken the opportunity to upgrade to Virtual Box 2.0.4. The upgrade for Ubuntu 8 goes fine, although EZ-Web is barfing on the upgrade; I have forgotten some password I need. (Hmm, I wonder if I should try the command line, or closing the postgres service first.)

I have amended my proxy set up script. I had not read the documentation carefully enough and tried to set up the proxied ports while the VM was running. This is bad. The new script now displays the parameters set,


case $2 in
make)   echo $0 make proxy
        ./VBoxManage.exe setextradata "Ubuntu 8" \\
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/Protocol" TCP
        ./VBoxManage.exe setextradata "Ubuntu 8" \\
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/GuestPort" ${port}
        ./VBoxManage.exe setextradata "Ubuntu 8" \\
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/HostPort" ${port}
         ;;
show|list|display) echo $0 list parameters for $key
        for property in Protocol GuestPort HostPort
        do
           ./VBoxManage.exe getextradata "Ubuntu 8" \\
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/${property}"
        done
        ;;
rm|remove) echo $0 remove proxy
        ./VBoxManage.exe setextradata "Ubuntu 8" \\
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/Protocol"
        ./VBoxManage.exe setextradata "Ubuntu 8" \\
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/GuestPort"
        ./VBoxManage.exe setextradata "Ubuntu 8" \\
                "VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/HostPort"
        ;;
esac

I set the key variable earlier in the program. As you can see I have used two idioms now, i.e. iteration and sequence and I am sure a horrendous function could make the code much more economic. However it would have a non real name like act or do which is a clue to a design error. I wonder what it would look like in Python. Mind you, another reason this code is so repetitive is that the shell interpreter doesn't do associative arrays. Boo!

The program now takes two arguments one to define the service and one to define the action. This is why the example above uses $2 as the case argument. The previous version of the code was published earlier this month here on this blog.

tags:

Comments:

Post a Comment:
Comments are closed for this entry.
About

DaveLevy

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today