I think you could just create a second resolv.conf (call it
resolv.conf.static or something like that).

To create a script to change it from dynamic to static, just use vi (or
whatever your favorite editor is) to create a file called switchdns.sh (or
whatever you want to call it).  Remember to make the script file executable
after you create it.

The script should look something like this:

#!/usr/bin/ksh
DYNAMIC_FILE="/etc/resolv.dynamic"
STATIC_FILE="/etc/resolv.static"
RESOLV_FILE="/etc/resolv.conf"
if [ ! -f $STATIC_FILE ]; then
    if [ ! -f $DYNAMIC_FILE ]; then
        echo "Nothing to do"
    else
        mv $RESOLV_FILE $STATIC_FILE
        mv $DYNAMIC_FILE $RESOLV_FILE
    fi
else
    mv $RESOLV_FILE $DYNAMIC_FILE
    mv $STATIC_FILE $RESOLV_FILE
fi


On Tue, Nov 18, 2008 at 5:21 PM, Ed <[EMAIL PROTECTED]> wrote:

>
> Are any of you regulars here Linux experts? Specifically, Linux
> scripting experts?
> I'm looking for a script to do some network interface changes
> automatically when launch from my Ubuntu desktop. Specifically, the
> DNS entry from dynamic to a specific static IP.
> Anyone here know how to do this?
> It was recommended on another tech forum (http://www.daniweb.com) to
> just do a rename of the /etc/resolve.conf back and forth.
> Thoughts? I'm looking for some real tech geeks here.
>
> E
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Unique Geek" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/theuniquegeek?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to