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
« May 2015
SunMonTueWedThuFriSat
     
2
3
5
8
9
10
12
13
14
16
17
23
24
25
26
27
28
29
30
31
      
Today