LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-17-2006, 11:06 PM   #1
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Rep: Reputation: 30
script question


well i've kinda got it working ... this is my script so far

/usr/bin/clear

echo "
***********************************************************************************
**************************Setup squid.conf File************************************
***********************************************************************************"
echo ""

A=/etc/squid/squid.conf
echo "Enter the path to the squid.conf file:"
printf "default path is = $A: "
read A
if [ "$A" = "" ]; then
A=/etc/squid/squid.conf
fi
echo ""

B=/usr/lib/squid/pam_auth
echo "Enter the path to the squid.conf file:"
printf "default path is = $B: "
read B
if [ "$B" = "" ]; then
B=/usr/lib/squid/pam_auth
fi
echo ""

a=$(grep -m1 -n "#Recommended minimum configuration:" < $A | cut -d: -f1)
sed -i ''$a's/#Recommended minimum configuration:/\
#Recommended minimum configuration:\
#Added by Server Setup Script\
auth_param basic program\
$B\
acl pam proxy_auth REQUIRED\
http_access allow pam\
#Added by Server Setup Script/' $A

and the problem now is in my /etc/squid/squid.conf file this comes out

#Added by Server Setup Script
auth_param basic program
$B
acl pam proxy_auth REQUIRED
http_access allow pam
#Added by Server Setup Script

it doesn't seam to output the variable, '/usr/lib/squid/pam_auth' can someone tell me how to do that?
 
Old 04-18-2006, 12:01 AM   #2
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
try adding spaces on the lines after the back-slash eg,

Code:
auth_param basic program\
$B\
acl pam proxy_auth REQUIRED\
is read as:
Code:
auth_param basic program$Bacl pam proxy_auth REQUIRED
but
Code:
(space)auth_param basic program\
(space) $B\
(space) acl pam proxy_auth REQUIRED\
is read as:

Code:
auth_param basic program ; $B ; acl pam proxy_auth REQUIRED ;
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
One last script question kinetik Linux - General 2 04-02-2006 05:47 PM
Script question yoderp Linux - General 8 07-06-2005 08:57 AM
Question on this script. Echo Kilo Programming 2 12-13-2004 04:20 AM
Script Question blubbfish Linux - Newbie 2 04-26-2004 04:18 AM
some script-question G.P.P. Linux - Newbie 3 01-11-2003 05:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration