running vncserver for just one command, bash function implementation

Real unix sysadmin may want to use X-window sometimes, like when you want to analyze network packet or install Oracle. So, here it is a bash function to run just a single command. 2 lines are commented out because Oracle installer didn't work. I'm sure most other commands are fine with these 2 lines. Tested on Solaris10 and RedHat4.
vncexec ()
{
    \\mv -i ~/.vnc/xstartup{,.$$};
    echo "$\* &" >~/.vnc/xstartup;
#    echo "onecommand=\\$!" >>~/.vnc/xstartup;
    echo "twm &" >>~/.vnc/xstartup;
#    echo "wait \\$onecommand; vncserver -kill \\$DISPLAY" >>~/.vnc/xstartup;
    chmod u+x ~/.vnc/xstartup;
    vncserver -geometry 1024x992;
    \\mv -i ~/.vnc/xstartup{.$$,}
}

Here's a sample how you run wireshark.
$ vncexec wireshark -r $PWD/ssl.snoop

Install oracle.
$ vncexec sh -x ~oracleidm/Disk1/runInstaller

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
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