#!/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="$WINHOME"/system32/drivers/etc ;; CYGWIN_9*) WINETC="$WINHOME" ;; *) echo "Unknown system type $OSNAME; exiting" >&2; exit 1 ;; esac FILES="hosts protocols services networks" for FILE in $FILES do if [ ! -e "/etc/$FILE" ] then # 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