nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Help with Automating VNC Setup

This is a discussion on Help with Automating VNC Setup within the Shell scripting forums, part of the Development/Scripting category; Greetings, i am a noob with shell scripting, just now started, i am trying to automate the VNCserver setup, for ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-14-2009, 01:52 PM
Junior Member
User
 
Join Date: Nov 2009
OS: Debian
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
eshav is on a distinguished road
Default Help with Automating VNC Setup

Greetings,

i am a noob with shell scripting, just now started, i am trying to automate the VNCserver setup, for which i have created a small script, please someone could correct it


vnc.sh
=====

Code:
ip=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
read -s -p "Enter vnc password : " password
read -p "Enter the VNC Port Number: " port
echo $password | vncserver :$port -stdin $password
echo "your VNc Details are:"
echo "---------------------"
echo "Hostname :" $ip:$port
echo "Password :" $password
echo "---------------------"
please help,

./vnc.sh
Enter vnc password : Enter the VNC Port Number: 24

You will require a password to access your desktops.

getpass error: Invalid argument

i have installed vnc4server on debian, please help

regards,
Esha

Last edited by nixcraft; 11-15-2009 at 01:17 PM.
Reply With Quote
  #2 (permalink)  
Old 11-15-2009, 01:17 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,677
Thanks: 11
Thanked 240 Times in 180 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Code:
 echo $password | vncserver :$port -stdin $password
This is not correct. There is no such option called -stdin for vncserver. Look at vncpasswd command. It may help.

Update your script as follows
Code:
#!/bin/bash
ip=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
read -p "Enter the VNC Port Number: " port
echo "Password setup:"
vncpasswd
echo "your VNc Details are:"
echo "---------------------"
echo "Hostname :" $ip:$port
#echo "Password :" $password
echo "---------------------"
HTH
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help

Last edited by nixcraft; 11-15-2009 at 01:23 PM.
Reply With Quote
  #3 (permalink)  
Old 11-15-2009, 08:34 PM
Junior Member
User
 
Join Date: Nov 2009
OS: Debian
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
eshav is on a distinguished road
Default

thnx vivek, i need to automate it too, because if i use vncpasswd, i need to type it, is there anyother method where i can stdin the password, after getting it

like

Code:
read -s -p "Enter vnc password : " password
read -p "Enter the VNC Port Number: " port
and pass the $password to vncpasswd, so i dont have to type it, please guide me vivek

regards,
Esha
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to Setup Wireles hoefman Linux hardware 0 04-15-2008 02:30 AM
about new mail server setup jhn_daz@yahoo.com Mail Servers 2 11-01-2007 09:43 AM
New user setup in sam swillet HP-UX 2 07-18-2007 08:19 PM
Sandmail Setup diptanjan Mail Servers 2 06-19-2007 09:53 AM
SpamAssassin setup. diptanjan Mail Servers 4 06-08-2007 09:48 AM


All times are GMT +5.5. The time now is 01:46 PM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

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 31 32 33 34 35 36 37 38