Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com Message-ID: <3D80A15A.D7D2CF13@pajhome.org.uk> Date: Thu, 12 Sep 2002 15:14:50 +0100 From: Paul Johnston X-Accept-Language: en MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Release candidate 1: /etc/hosts Content-Type: multipart/mixed; boundary="------------50E01E77144081DDBE279FD3" --------------50E01E77144081DDBE279FD3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, Thanks to Corinna, Joe, Nicholas, Warren and especially Igor, this script should now be good enough. I've successfully tested it on XP only. BTW, this version uses uname to get the OS - the most reliable way. Also, if for some reason a user wanted to lie to the script, uname would be the obvious choice without having to read to source. Paul --------------50E01E77144081DDBE279FD3 Content-Type: application/x-sh; name="make-etc-links.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="make-etc-links.sh" #!/bin/sh #-- # Create symbolic links from some /etc files to the Windows equivalents #-- FILES="hosts protocols services networks" OSNAME=`/bin/uname -s` WINHOME=`/bin/cygpath -W` case "$OSNAME" in CYGWIN_NT*) WINETC="$WINHOME/system32/drivers/etc" ;; CYGWIN_9*|CYGWIN_ME*) WINETC="$WINHOME" ;; *) echo "Unknown system type $OSNAME; exiting" >&2 exit 0 ;; esac if [ ! -d "$WINETC" ] then echo "Directory $WINETC does not exist; exiting" >&2 exit 0 fi for FILE in $FILES do if [ ! -e "/etc/$FILE" ] then # Windows only uses the first 8 characters WFILE=`expr substr "$FILE" 1 8` /bin/ln -s -v "$WINETC/$WFILE" "/etc/$FILE" fi done --------------50E01E77144081DDBE279FD3 Content-Type: text/plain; charset=us-ascii -- 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/ --------------50E01E77144081DDBE279FD3--