Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 03 Sep 2014, 03:25
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Add internet DNS servers.
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Mon 28 Feb 2011, 11:52    Post subject:  Add internet DNS servers.
Subject description: Yad script GUI
 

Every time i make a new puppy install i have to manually edit the resolv.conf.head file to add my ISP DNS servers.

This is a little Yad GUI script to do it.



To use:
Add your DNS servers then restart your internet connection.

Requires Yad.
http://www.murga-linux.com/puppy/viewtopic.php?t=58306

Script.
Code:
#!/bin/bash
#stu90

HEAD="/etc/resolv.conf.head"
PDNS="/tmp/pdns"
yad --title="DNS Config" --text=" Add new DNS servers and restart \n your internet connection. " \
 --form --field="DNS1" --field="DNS2" > $PDNS

button=$?
case $button in
0)
if [ ! -f "$HEAD" ]; then
touch $HEAD | echo "no $HEAD file created new file"
else
mv $HEAD $HEAD.old | echo "$HEAD already exists backed up to $HEAD.old"
fi

DNS1=$(cut -s -d "|" -f 1 $PDNS)
DNS2=$(cut -s -d "|" -f 2 $PDNS)

echo "# Generated by dhcpcd from wlan0" >> $HEAD
echo "# /etc/resolv.conf.head can replace this line" >> $HEAD
echo "nameserver $DNS1" >> $HEAD
echo "nameserver $DNS2" >> $HEAD
echo "added DNS $DNS1 / $DNS2 to $HEAD restart internet to apply new DNS settings"
;;
1)
exit 0 | echo "cancel"
;;
esac
rm -f $PDNS
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0451s ][ Queries: 11 (0.0114s) ][ GZIP on ]