The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > Linux > Red Hat
.
google unix.com



Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ksh: cmd output to input of another script IMTheNachoMan Shell Programming and Scripting 2 04-27-2008 10:58 AM
Using output to input another command rodrimuino Shell Programming and Scripting 3 02-14-2008 12:37 PM
Using Output from one command as input to another BkontheShell718 Shell Programming and Scripting 2 12-26-2007 04:23 PM
v3fshelper: There is an input or output error padawan75 AIX 2 11-21-2007 08:56 AM
log script input and output using tee ? moseschrist Shell Programming and Scripting 0 11-12-2006 03:32 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-31-2007
maskot maskot is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 20
kickstart output/input

Hello Linux gurus!

Ive got a RedHat EnterP. 4 kickstart server that is also running RedHat EnterP 4.
It is working as i should and no problem at all.
However, now i want to run a little script with output and input.
Ive read up a bit and what i realized is that a input in %pre phase is not a problem.
Example: echo "ip adress" > /etc/hosts
BUT
I want a little handy script that actually asks with an output what kind of ip adress he/she/that/whatever want to, even tho it want be totally self installing.

Something more or less like this:
echo "ip adress?"
read adress
echo $adress > /etc/hosts

//
Your Maskot
  #2 (permalink)  
Old 05-31-2007
maskot maskot is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 20
answer

You dont have to know the answer, more or less i want to know if it is possible.
But if you got any tip on HOW TO i wouldnt cry either
  #3 (permalink)  
Old 05-31-2007
maskot maskot is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 20
follow up

first of all i am aware of that /etc/hosts dont contain the actually ip adress but hostname, its an example.

Another way to solve this problem is to set variables i guess...

#!/bin/sh
touch /etc/profile.d/file

echo "hostname?"
read hostname
echo "http proxy?"
read proxy
echo "ip address?"
read address

echo "HOSTNAME=$hostname" > /etc/profile.d/file
echo "http_proxy=$proxy" > /etc/profile.d/file
echo "IPADDR=$address" > /etc/profile.d/file

But the problem is still, how do i get an output that actually work, my guess is to send it to another tty?
  #4 (permalink)  
Old 05-31-2007
maskot maskot is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 20
answer

Doesnt seems like many of you very intressdid in this thread.
Anyway i come up with an solution of it happends to have the same problem.

Under %post in your kickstart server config:
#!/bin/sh
chvt 3
exec < /dev/tty3 > /dev/tty3

echo "hostname?"
read hostname
echo "http proxy?"
read proxy
echo "ip address?"
read address

echo "IPADDR=$address" > /etc/sysconfig/network-scripts/ifcfg-eth0
echo "$hostname" > /etc/hosts
echo "http_proxy=$proxy" > /etc/profile.d/file
chvt 1
exec < /dev/tty1 > /dev/tty1
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On




All times are GMT -4. The time now is 12:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0