Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Help With Bash Script, automatic setting the proxyserver
aargh
post Mar 1 2004, 07:09 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 4
Joined: 1-March 04
Member No.: 2,500



Hi.

I use my laptop at home and at school. But the school use a proxyserver so I have to set it up the first time I use mozilla and each time I open a terminal window.

I figured this could be automated because the DNS is detected at startup and saved in /etc/resolv.conf.

So I tried writing a script something like this:

--------------------
#!bin/bash
DNS=grep -a stud /etc/resolv #If at school the string is 'search stud.but.auc.dk'

DNS_WITH_PROXY="search stud.but.auc.dk" #the DNS which requires a proxy

if [&DNS == &DNS_WITH_PROXY];
then export http_proxy #sets the proxyserver.
fi
---------------------


Well.. my problem is the condition in the if/then. How can I compare two values of variables and if equal -> then...?

Sorry.. I don't yet understand the way the script language works. I've looked in the tutorials without luck. Hope someone can help me out. Maybe even an easier way to solve the problem;-)
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th October 2017 - 08:29 PM