Sponsored Content
Top Forums Shell Programming and Scripting Simple script to modify kickstart file Post 302193244 by primp on Thursday 8th of May 2008 09:16:05 PM
Old 05-08-2008
[root@atlantis ~]# cat generateKickstartConfig.sh

Code:
#!/bin/sh

#define outputfile
KS_CONFIG=ks.cfg

echo -e "Starting Kickstart Configuration Generator Script ...\n"

echo -en "\tWhat is the IP Address:"
read IP_ADDRESS

echo -en "\tWhat is the gateway Address:"
read GATEWAY_ADDRESS

echo -en "\tWhat is the DNS Server:" 
read DNS_SERVER

echo -en "\tWhat is the Hostname:"
read HOSTNAME

echo "network --device eth0 --bootproto static --ip ${IP_ADDRESS} --netmask 255.255.255.0 --gateway ${GATEWAY_ADDRESS} --nameserver ${DNS_SERVER} --hostname ${HOSTNAME}" >> ${KS_CONFIG}

Remember to make the script executable
Execute with ./generateKickstartConfig.sh
Answer the 4 questions and "ls" your directory, you'll see a ks.cfg file

This is a very basic solution, there's so many possiblities, you can verify the user input to check to see if the values are valid, like if they enter an IP for hostname or vice versa, check DNS to see if these IPs resolve before using them in the kickstart, use regular expression to verify the user input, if its invalid you can loop to verify they enter something useful, I mean you can write a pretty complicated script to generate your ks.cfg file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modify script to generate a log file

I've seen several examples of scripts in thise forum about having a script generate a log file. I have a script that is run from cron and that monitors a file system for a specfic filename(s) and then performs some actions on them. Normally I call this script from another script (which the one... (2 Replies)
Discussion started by: heprox
2 Replies

2. Shell Programming and Scripting

how to modify a file using shell script

Hi, i am using SuonOS and ksh. i need to add data into a file(s.txt) using a shell script. i have to pass 3 parameters and these 3 paramaters should add into the file at end of the file. File s.txt is look like, --------------------------------- column1|column2|column3 ... (1 Reply)
Discussion started by: syamkp
1 Replies

3. Shell Programming and Scripting

Need to modify a file of different username through script.

Hi ! All I want to write a script where, it will open a new shell with a username / pwd and modify a file of same username and exit. example: 1. UserA 2. UserB- FileB ScriptA -> su UserB -> Modify FileB -> Exit ScriptA Can somebody give me a direction , on how to... (2 Replies)
Discussion started by: dashok.83
2 Replies

4. Shell Programming and Scripting

How to modify the contents of file using script

Hi, Can anyone pls let me know how can i modify the file contents thru script. Eg. I have file abc.dat that contains below lines Merge.resync.cycleFlag Merge.resync.logFlag Merge.resync.maxByteRate Merge.resync.maxSearch Merge.resync.rate Merge.resync.tickLog ... (2 Replies)
Discussion started by: sdosanjh
2 Replies

5. Shell Programming and Scripting

Need to modify csv-file with bash script

Hi Guys, I need to write a script, that exports the "moz_places" table of the "places.sqlite"-file (firefox browser history) into a csv-file. That part works. After the export, my csv looks like this: ... 4429;http://www.sqlite.org/sqlite.html;"Command Line Shell For... (11 Replies)
Discussion started by: Sebi0815
11 Replies

6. Shell Programming and Scripting

Modify text file using shell script

Hi, I have a text file which is following format - COL VAL ABC 1 ABC 2 ABC 3 ABC 4 ABC 5 My requirement is to search for a particular value (provided by user) in the file and comment the previous entries including that as well. E.g. If I search for number 3, then the output... (6 Replies)
Discussion started by: bhupinder08
6 Replies

7. Shell Programming and Scripting

Shell script to modify file in several directories

Hi, I want a script shell to automate modifying httpd.conf file for several instances of apache, save httpd.file before changing it, after modifying it and then restart apache. - Replace ServerRoot "xxxx" by ServerRoot "yyyy" of all directories : "... (4 Replies)
Discussion started by: bras39
4 Replies

8. Shell Programming and Scripting

Modify the file by script

Hi All, I have an input file like below, 6984 1225 6989 1220 6994 1214 ... (3 Replies)
Discussion started by: Indra2011
3 Replies

9. Shell Programming and Scripting

Modify the text file by script

Hi All the Helpers! I have a text file which looks like input.txt.I would request to please suggest me how can I make this file look like output.txt input.txt VOP 111 0 1 2 DEM 111 0 222 333 444 555 879 888 987 888 989 VOP 118 0... (2 Replies)
Discussion started by: Indra2011
2 Replies

10. Shell Programming and Scripting

modify the test file by any script

Hi All the Helpers! I have a text file which looks like input.txt.I would request to please suggest me how can I make this file look like output.txt input.txt VOP 111 0 1 2 DEM 111 0 222 333 444 555 DEM 879 888 987 888 989 DEM 879 888 987 888 989 VOP 118 0 12 3 6... (7 Replies)
Discussion started by: Indra2011
7 Replies
Vend::Payment::ECHO(3pm)				User Contributed Perl Documentation				  Vend::Payment::ECHO(3pm)

NAME
Vend::Payment::ECHO - Interchange ECHO Support AUTHOR
Michael Lehmkuhl <michael@electricpulp.com>. Ported to Vend::Payment by Dan Browning <db@kavod.com>. Code reused and inspired by Mike Heins <mike@perusion.com>. SPECIAL THANKS
Jim Darden <support@openecho.com>, Dan Browning <db@kavod.com> SYNOPSIS
&charge=echo or [charge mode=echo param1=value1 param2=value2] PREREQUISITES
If you have not done so already, you will need to sign up for an ECHO account. You will be provided an ID and a PIN (also known as 'secret'). You may also sign up for a test account at the following URL: http://www.echo-inc.com/echotestapp.php This subroutine uses the OpenECHO module. Make sure OpenECHO.pm is in your @INC array. It is available for download, see the following URLs: http://www.openecho.com/ http://www.echo-inc.com/ The OpenECHO.pm module itself has some additional prerequisites: Net::SSLeay or LWP::UserAgent and Crypt::SSLeay Only one of these need be present and working. Net::SSLeay is preferred as some have reported problems using LWP::UserAgent and Crypt::SSLeay. URL::Escape This module is used to write some of the URLs used by the OpenECHO module. It is recommended that you read the documention for the OpenECHO module itself in addition to this document. DESCRIPTION
The Vend::Payment::ECHO module implements the echo() routine for use with Interchange. It is compatible on a call level with the other Interchange payment modules. To enable this module, place this directive in "interchange.cfg": Require module Vend::Payment::ECHO This must be in interchange.cfg or a file included from it. NOTE: Make sure CreditCardAuto is off (default in Interchange demos). The mode can be named anything, but the "gateway" parameter must be set to "echo". To make it the default payment gateway for all credit card transactions in a specific catalog, you can set in "catalog.cfg": Variable MV_PAYMENT_MODE echo It uses several of the standard settings from Interchange payment. Any time we speak of a setting, it is obtained either first from the tag/call options, then from an Interchange order Route named for the mode, then finally a default global payment variable, For example, the "id" parameter would be specified by: Route echo id Your_ECHO_ID or (with only ECHO as a payment provider) Variable MV_PAYMENT_ID Your_ECHO_ID or Variable ECHO_PAYMENT_ID Your_ECHO_ID or [charge mode=echo id=Your_ECHO_ID] The active settings are: id Your account ID, supplied by ECHO when you sign up. Global parameter is MV_PAYMENT_ID or ECHO_PAYMENT_ID. secret Your account password, selected by you or provided by ECHO when you sign up. Global parameter is MV_PAYMENT_SECRET or ECHO_PAYMENT_SECRET. others... If planning to do AUTH_ONLY or other with special admin page Variable MV_PAYMENT_REMAP order_id=mv_order_id auth_code=mv_auth_code Variable ECHO_PAYMENT_ORDER_TYPE S # S for "self-service" orders # F for hosted or ISP orders Variable ECHO_PAYMENT_ISP_ECHO_ID 123<4567890 Variable ECHO_PAYMENT_ISP_PIN 12345608 Variable ECHO_PAYMENT_MERCHANT_EMAIL merchant@merchant.com Variable ECHO_PAYMENT_DEBUG F # C causes ECHO to return a statement of conformity # T or TRUE causes ECHO to return additional debug information # Any other value turns off ECHO debugging Example Configuration This is an example configuration that one would add to catalog.cfg: Variable MV_PAYMENT_ID Your_ECHO_ID Variable MV_PAYMENT_SECRET Your_ECHO_secret Variable MV_PAYMENT_MODE echo Troubleshooting Try a sale with the card number "4111 1111 1111 1111" and a valid expiration date. The sale should be denied, and the reason should be in [data session payment_error]. If nothing works: o Make sure you "Require"d the module in interchange.cfg: Require module Vend::Payment::ECHO o Make sure the ECHO "OpenECHO.pm" module is available either in your path or in /path_to_interchange/lib. o Check the error logs, both catalog and global. o Make sure you set your account ID and secret properly. o Try an order, then put this code in a page: <XMP> [calc] my $string = $Tag->uneval( { ref => $Session->{payment_result} }); $string =~ s/{/{ /; $string =~ s/,/, /g; return $string; [/calc] </XMP> That should show what happened. o If all else fails, Interchange consultants are available to help with integration for a fee. SECURITY CONSIDERATIONS
Because this library calls an executable, you should ensure that no untrusted users have write permission on any of the system directories or Interchange software directories. NOTES
There is actually nothing *in* Vend::Payment::ECHO. It changes packages to Vend::Payment and places things there. perl v5.14.2 2011-03-09 Vend::Payment::ECHO(3pm)
All times are GMT -4. The time now is 09:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy