public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Igor Pechtchanski <pechtcha@cs.nyu.edu>
To: Paul Johnston <paj@pajhome.org.uk>
Cc: cygwin@cygwin.com
Subject: Re: Beginnings of a patch: /etc/hosts
Date: Tue, 10 Sep 2002 13:36:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.44.0209101519230.1269-300000@slinky.cs.nyu.edu> (raw)
In-Reply-To: <3D7E3895.A13DDF9B@pajhome.org.uk>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1841 bytes --]

On Tue, 10 Sep 2002, Paul Johnston wrote:

> (back in main cygwin list as Robert pointed out this is not a setup
> change)
>
> Hi,
>
> I've created an NT-only postinstall script that should be suitible. I
> suggest it's called /etc/postinstall/make-etc-links.sh I don't have
> access to a Win 9x machine right now - if someone else could do this
> bit, that would be great; alternatively I will be able to do it in the
> next week or so.
>
> Paul
>
>
> #!/bin/sh
> #--
> # Creates symbolic links from some /etc files to their windows
> equivalents
> #--
> VERBOSE=-v
>
> if [ "$OS" = "Windows_NT" ]
> then
>   WINETC=`/bin/cygpath $SYSTEMROOT`/system32/drivers/etc
>   FILES="hosts protocol services"
> fi
>
> for FILE in $FILES
> do
>   if [ ! -e /etc/$FILE ]
>   then
>     /bin/ln -s $VERBOSE ${WINETC}/$FILE /etc/$FILE
>   fi
> done
>
> > NT has an equivalent to /etc/hosts, so I think the cygwin install should
> > create this symbolic link:
> >
> > /etc/hosts -> ${SYSTEMROOT}/system32/drivers/etc/hosts

9x systems also have these files, they should reside in ${WINBOOTDIR}.
You also omitted a file called 'networks'.

Attached are a new version of your script, as well as a diff with your
original version.

Note also that the links should probably use proper case for the path and
filenames, in case someone has CYGWIN=*check_case:strict*.  I'm not sure
how to do this properly (use [cmd /c "dir /b "`cygpath -w $file`], maybe?)
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file

[-- Attachment #2: Type: TEXT/PLAIN, Size: 623 bytes --]

--- make-etc-links.sh-orig	2002-09-10 15:39:42.000000000 -0400
+++ make-etc-links.sh	2002-09-10 15:39:37.000000000 -0400
@@ -4,11 +4,14 @@
 #--
 VERBOSE=-v
 
-if [ "$OS" = "Windows_NT" ]
-then
-  WINETC=`/bin/cygpath $SYSTEMROOT`/system32/drivers/etc
-  FILES="hosts protocol services"
-fi
+OSNAME=`/bin/uname -s`
+
+case "$OSNAME" in
+   CYGWIN_NT*) WINETC=`/bin/cygpath $SYSTEMROOT`/system32/drivers/etc ;;
+   CYGWIN_9*) WINETC=`/bin/cygpath $WINBOOTDIR` ;;
+   *) echo "Unknown system type $OSNAME; exiting" >&2; exit 1 ;;
+esac
+FILES="hosts protocol services networks"
 
 for FILE in $FILES
 do

[-- Attachment #3: Type: TEXT/PLAIN, Size: 522 bytes --]

#!/bin/sh
#--
# Creates symbolic links from some /etc files to their windows equivalents
#--
VERBOSE=-v

OSNAME=`/bin/uname -s`

case "$OSNAME" in
   CYGWIN_NT*) WINETC=`/bin/cygpath $SYSTEMROOT`/system32/drivers/etc ;;
   CYGWIN_9*) WINETC=`/bin/cygpath $WINBOOTDIR` ;;
   *) echo "Unknown system type $OSNAME; exiting" >&2; exit 1 ;;
esac
FILES="hosts protocol services networks"

for FILE in $FILES
do
  if [ ! -e /etc/$FILE ]
  then
    /bin/ln -s $VERBOSE ${WINETC}/$FILE /etc/$FILE
  fi
done


[-- Attachment #4: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

  reply	other threads:[~2002-09-10 19:49 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-09  2:45 Suggestion: /etc/hosts Paul Johnston
2002-09-09  5:38 ` Nicholas Wourms
2002-09-09  5:40   ` Marcos Lorenzo de Santiago
2002-09-09  6:51 ` Joe Buehler
2002-09-09  7:32   ` Christopher Faylor
2002-09-10  2:19     ` Paul Johnston
2002-09-11  7:43       ` Jim
2002-09-09 11:25 ` news
     [not found] ` <E17oTbC-0001AV-00@quimby.gnus.org>
2002-09-10  9:52   ` Shankar Unni
2002-09-10 11:46 ` Beginnings of a patch: /etc/hosts Paul Johnston
2002-09-10 13:36   ` Igor Pechtchanski [this message]
2002-09-11  0:59     ` John Morrison
2002-09-11  2:06       ` Corinna Vinschen
2002-09-11  9:57   ` Joe Buehler
2002-09-11 11:17     ` Igor Pechtchanski
2002-09-11 11:42       ` Joe Buehler
2002-09-11 12:39         ` Igor Pechtchanski
2002-09-11 14:24           ` Paul Johnston
2002-09-11 14:53             ` Warren Young
2002-09-11 15:37               ` Igor Pechtchanski
2002-09-11 15:40                 ` Paul Johnston
2002-09-11 16:15                   ` Igor Pechtchanski
2002-09-11 16:35                     ` Robert Collins
2002-09-11 17:10                       ` Randall R Schulz
2002-09-11 17:26                         ` OT " Igor Pechtchanski
2002-09-12  4:33                           ` Nicholas Wourms
2002-09-12  4:46                             ` Nicholas Wourms
2002-09-11 19:00                         ` Christopher Faylor
2002-09-12  8:56                           ` Joe Buehler
2002-09-11 23:25                         ` Robert Collins
2002-09-12  4:11                         ` Nicholas Wourms
2002-09-11 17:14                       ` Igor Pechtchanski
2002-09-12  1:27                         ` Robert Collins
2002-09-11 17:54                 ` Igor Pechtchanski
2002-09-12  4:08                 ` Nicholas Wourms
2002-09-12 10:08                   ` Warren Young
2002-09-12 10:11                 ` Warren Young
2002-09-10 13:54 ` Suggestion: /etc/hosts Warren Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.44.0209101519230.1269-300000@slinky.cs.nyu.edu \
    --to=pechtcha@cs.nyu.edu \
    --cc=cygwin@cygwin.com \
    --cc=paj@pajhome.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).