--- make-etc-links.sh-orig 2002-09-10 15:39:37.000000000 -0400 +++ make-etc-links.sh 2002-09-11 14:07:31.000000000 -0400 @@ -1,23 +1,42 @@ #!/bin/sh #-- # Creates symbolic links from some /etc files to their windows equivalents +# +# Version: 0.3 +# +# ChangeLog: +# v0.3 Igor Pechtchanski : +# Quote variable references +# Use `cygpath -W` instead of "$SYSTEMROOT" +# Change protocol to protocols on cygwin +# Add ChangeLog +# v0.2 Igor Pechtchanski : +# Use `uname -s` instead of "$OS" +# Add Win9x support +# Add networks file +# v0.1 Paul Johnston : +# Initial version #-- + VERBOSE=-v OSNAME=`/bin/uname -s` +WINHOME=`/bin/cygpath -W` case "$OSNAME" in - CYGWIN_NT*) WINETC=`/bin/cygpath $SYSTEMROOT`/system32/drivers/etc ;; - CYGWIN_9*) WINETC=`/bin/cygpath $WINBOOTDIR` ;; + CYGWIN_NT*) WINETC="$WINHOME"/system32/drivers/etc ;; + CYGWIN_9*) WINETC="$WINHOME" ;; *) echo "Unknown system type $OSNAME; exiting" >&2; exit 1 ;; esac -FILES="hosts protocol services networks" +FILES="hosts protocols services networks" for FILE in $FILES do - if [ ! -e /etc/$FILE ] + if [ ! -e "/etc/$FILE" ] then - /bin/ln -s $VERBOSE ${WINETC}/$FILE /etc/$FILE + # Windows only uses the first 8 characters + WFILE=`echo $FILE | sed 's/^\(.\{0,8\}\).*/\1/'` + /bin/ln -s $VERBOSE "$WINETC/$WFILE" "/etc/$FILE" fi done