Mail Archives: cygwin/2002/09/12/10:08:17
--------------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--
- Raw text -