[SC.LUG] [Fwd: Perl]

Richard Smedley sc at mailman.lug.org.uk
Mon Jul 21 16:53:01 2003


Think this was intended for the list...

-----Forwarded Message-----
From: Jonathan Dwerryhouse <jon.d@c2internet.net>
To: 'richard.smedley@livepublishing.co.uk' <richard.smedley@livepublishing.co.uk>
Subject: Perl
Date: 21 Jul 2003 16:10:56 +0100

Hi Richard,
 
I don't know if anyone can point me in the right direction.  I'm still keen
to get down to your next meeting- I could do with a few mentors around me!
 
I wish to write a bash script that will prompt about 4 or 5 questions and
with the answers I provide will input these answers into a standard template
and append at the end of a file (this is for the purpose of adding records
to a RADIUS users file).  
 
Here's a basic template:
 
User1    Auth-Type = Local, Password = "chek27ny", Called-Station-Id =
"8007835373"
            Service-Type = Framed-User,
            Framed-Protocol = PPP,
            Framed-IP-Address = 255.255.255.254,
            Idle-Timeout = 300
 
Hence all I want to update here would be the User1 text and Password "".  
 
My inclination from reading is to use Perl.  Do you agree?  
 
If so, I have two points to cover:
 
1)  How do I get a script to (after asking questions) take the answer data
and pipe it into the said fields (presumably with $variables)?
2)  How do I get this updated template appended to the end of a file?
 
Any help would be greatly appreciated!
 
Kind Regards
 
Jonathan Dwerryhouse
Senior Account Manager
C2 Internet Ltd
Alvaston House
Alvaston Business Park
Nantwich
Cheshire
CW5 6PF
0845 658 0020
www.c2internet.net <http://www.c2internet.net> 
 
-- 
Richard Smedley
Production Editor, LinuxUser & Developer
 
T: +44 (0)1625 855084, F: +44 (0)1625 855071
richard.smedley@linuxuser.co.uk

http://www.linuxuser.co.uk/
The GNU/Linux magazine for IT decision makers

     ``The public have an insatiable curiosity to know everything. 
     Except what is worth knowing. Journalism, conscious of this, 
     and having tradesman-like habits, supplies their demands.''
                                                       -- Oscar Wilde
     

This email message may contain privileged or confidential information. The information is intended for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that disclosure, copying, distribution or the taking of action in reliance on the contents of this electronic information is strictly prohibited. If you have received this email in error, please notify postmaster@livepublishing.co.uk immediately via reply email. Any personal content in this email is that of the individual author and should not be interpreted as being endorsed by the company in whole or in part. Whilst care is taken, it is the responsibility of the recipient to ensure that this email is free from virus infection, and no responsibility is accepted by Live Publishing Group for any disruption, loss or damage arising from its receipt or use.